我有许多按正确顺序注释的 MKMapView。我有按钮来改变地图模式:
- (IBAction)userDidPressTrackButton:(id)sender {
if (self.mapView.userTrackingMode == MKUserTrackingModeFollow) {
self.mapView.userTrackingMode = MKUserTrackingModeFollowWithHeading;
return;
}
if (self.mapView.userTrackingMode == MKUserTrackingModeFollowWithHeading) {
self.mapView.userTrackingMode = MKUserTrackingModeNone;
return;
}
if (self.mapView.userTrackingMode == MKUserTrackingModeNone) {
self.mapView.userTrackingMode = MKUserTrackingModeFollow;
}
}
当 mode =MKUserTrackingModeFollowWithHeading
注释开始以随机顺序排列自己时。似乎在这种模式下,mapview 开始每秒重新绘制自己,并将所有子视图(注释)以未知的顺序放置。
如何取消注释的更改顺序?