iOS如何始终保持当前的位置中心

Mom*_*ntH 5 iphone core-location mkmapview ios

我的地图显示当前位置有蓝点.当然,当我移动时,蓝点移动..我只是想一直保持地图的蓝点中心,使地图移动而不是谷歌地图导航器..

我搜索了很多但找不到方法......

Dan*_*son 8

在地图视图委托中,执行以下操作:

- (void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation
{
    [mapView setCenterCoordinate:userLocation.location.coordinate animated:YES];
}
Run Code Online (Sandbox Code Playgroud)