1
我已成功更改MKAnnotationView以使用我的自定义图像和下面的代码片段。然而,我的问题是,一旦我启用默认引脚动画使用无法使用自定义图像执行MKAnnotationView动画删除
annotationView.animatesDrop = YES;
自定义图像消失,并使用默认的红色引脚。有没有什么办法解决这一问题? 感谢
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(MyAnnotation *)annotation
{
if ([annotation isKindOfClass:[MKUserLocation class]])
return nil;
// try to dequeue an existing pin view first
static NSString* identifier = @"AnnotationIdentifier";
MKPinAnnotationView *annotationView = (MKPinAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:identifier];
if (annotationView == nil) {
annotationView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:identifier];
annotationView.enabled = YES;
annotationView.canShowCallout = YES;
//!!!!!!!annotationView.animatesDrop = YES;!!!!!!!!!!
} else {
annotationView.annotation = annotation;
}
annotationView.image = [UIImage imageNamed:@"bla.png"];
return annotationView;
}
是的,你需要做的动画你自。我没有想到Offset,但它当然可以解决地图和视图的所有协调问题。 – 2012-04-19 15:21:19