Iphone 有没有合适的方法来设置MKUserTrackingModeFollow的区域?

Iphone 有没有合适的方法来设置MKUserTrackingModeFollow的区域?,iphone,mapkit,Iphone,Mapkit,在我的密码里,我在打电话 - (IBAction)goToUserLocation:(id)sender { [mapView setUserTrackingMode:MKUserTrackingModeFollow animated:YES]; } 然后有这个回调 - (MKAnnotationView *)mapView:(MKMapView *)theMapView viewForAnnotation:(id <MKAnnotation>)annotation {

在我的密码里,我在打电话

- (IBAction)goToUserLocation:(id)sender {
    [mapView setUserTrackingMode:MKUserTrackingModeFollow animated:YES];
}
然后有这个回调

- (MKAnnotationView *)mapView:(MKMapView *)theMapView viewForAnnotation:(id <MKAnnotation>)annotation
{
   // I then try to set the region in here, which doesnt always work.  Sometimes it zooms into the user location, then zooms back out to the region I specify.  Other times, it will just stay zoomed in.
}
-(MKAnnotationView*)映射视图:(MKMapView*)注释的映射视图:(id)注释
{
//然后我尝试在这里设置区域,这并不总是有效。有时它会放大到用户位置,然后缩小到我指定的区域。其他时候,它只会保持放大状态。
}
MKUserTrackingModeFollow的放大比我想象的要大得多。我希望能够对其进行设置,以便将其放大到我指定的区域。是否有适当的方法执行此操作,或者MKUserTrackingModeFollow的区域是否已设置


谢谢大家!

viewForAnnotation
是完全错误的位置。当地图决定需要在地图上绘制注释时,将调用该函数。如果当有人按下goToUserLocation按钮时,地图已经在屏幕上,则地图可能不需要重新绘制注释


相反,请尝试在设置跟踪模式之前或动画完成之后设置缩小区域

我不确定如何在跟踪模式之前设置缩小区域,因为它需要坐标来设置周围的区域。在使用当前中心点之前,可以设置区域。我发现当使用“跟踪模式”按钮打开跟踪模式时,它通常会将地图平移到我当前的位置,并且不会改变缩放。