我的 map 用蓝点显示了当前位置。
当然,当我移动时,蓝点也会移动。我只想一直保持蓝点在 map 中心,从而使 map 在移动,就像Google map 导航器一样。
我搜索了很多,但找不到路...
最佳答案
在您的 map View 委托(delegate)中,执行以下操作:
- (void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation
{
[mapView setCenterCoordinate:userLocation.location.coordinate animated:YES];
}
关于iphone - iOS如何始终保持当前位置中心,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/7461553/