マップ上の通常のピンの代わりにカスタム イメージを設定したいと思います。また、開いて、それぞれにドロップアニメーションを追加できるようにしたい.
なにか提案を?
編集:これが私が持っているすべてです
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(ActivityAnnotation *)annotation
{
static NSString* AnnotationIdentifier = @"AnnotationIdentifier";
MKPinAnnotationView* pinView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:AnnotationIdentifier];
pinView.animatesDrop=YES;
pinView.canShowCallout=YES;
UIImage *image = [UIImage imageNamed:@"Map_Pin"];
pinView.image = image;
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
imageView.frame = CGRectMake(-2.5,6,27,30);
[pinView addSubview:imageView];
UIButton* rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
rightButton.tag = [activities indexOfObject:annotation.activity];
[rightButton addTarget:self action:@selector(showDetails:) forControlEvents:UIControlEventTouchUpInside];
pinView.rightCalloutAccessoryView = rightButton;
return pinView;
}
すべて正常に動作しますが、元のピンがデフォルトの画像の背後に表示され続けます。どうすれば消去できますか?