我想知道这里有什么问题。注释显示默认的红色引脚。我已将图像文件复制到项目文件夹中并检查了名称。
- (MKAnnotationView *)mapView:(MKMapView *)aMapView
viewForAnnotation:(id)ann {
NSString *identifier = @"myPin";
MKPinAnnotationView *annView = (MKPinAnnotationView *)
[aMapView dequeueReusableAnnotationViewWithIdentifier:identifier];
if (annView == nil) {
annView= [[[MKPinAnnotationView alloc] initWithAnnotation:ann
reuseIdentifier:identifier]
autorelease];
} else {
annView.annotation = ann;
}
annView.rightCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
UIImage *pinImage = [UIImage imageNamed:@"AnnotationIcon.png"];
[annView setImage: pinImage];
annView.enabled = YES;
annView.animatesDrop=TRUE;
annView.canShowCallout=YES;
return annView;
}
答案 0 :(得分:0)
经过一番研究,我发现MKPinAnnotationView - animatesDrop属性不能用于自定义图像。