MKMapView centerCoordinate not exact

后端 未结 1 443
花落未央
花落未央 2021-01-28 06:34

When I try to place a pin in the center of the map using MKMapView\'s centerCoordinate it puts a pin roughly in the center, but it\'s several pixels south of th

1条回答
  •  有刺的猬
    2021-01-28 06:39

    Well I still don't know why in iOS7 MKMapView.convertPoint(MKMapView.center) differs from MKMapView.centerCoordinate, but did figure out why .centerCoordinate was off.

    Part of the map was under the status bar and I ruled the center based on the visible part and overlaying images centered on the visible part, but the map computed center based on the whole map. So once I fixed the map not running under the status bar .centerCoordinate works and, on iOS7, works better than MKMapView.center.

    0 讨论(0)
提交回复
热议问题