次のコードスニペットでカスタムイメージを使用するよう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;
}
本当に便利回答悪魔のおかげで、はい、あなたはアニメーションあなたを行う必要があります自己。オフセットのことは考えていませんでしたが、マップやビューですべての座標問題を解決しました。 –