我想在地图上设置自定义图像而不是普通图钉。我还希望它能够打开并为每个添加放置动画。
有什么建议吗?
编辑:这就是我所拥有的
- (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;
}
一切正常,但原始图钉一直显示在我的默认图像后面。我怎样才能抹去它?