我有这个代码,在iOS6中我将一个标记放在mapview的中心,它不会发生在iOS 7中为什么?
- (void)mapView:(MKMapView *)mapView didAddAnnotationViews:(NSArray *)views {
MKMapRect zoomRect = MKMapRectNull;
for (id <MKAnnotation> annotation in mapView.annotations)
{
MKMapPoint annotationP = MKMapPointForCoordinate(annotation.coordinate);
MKMapRect pointRect = MKMapRectMake(annotationP.x, annotationP.y, 7000, 7000);
if (MKMapRectIsNull(zoomRect)) {
zoomRect = pointRect;
} else {
zoomRect = MKMapRectUnion(zoomRect, pointRect);
}
}
[mapView setVisibleMapRect:zoomRect animated:YES];
}