假设我有一个保存在iPhone上的图像,并且我称为MKAnnotationDelegate
的类实现了MKAnnotation
协议。把图像放入mapView注释
我可以在使用该类的地图视图上显示注释,但无法弄清楚如何设置标注acccessory并放入图像中。
所以我已经实现了MKMapiewDelegate
协议,并给出了类UIImage
属性,定义
-(MKAnnotationView *) mapView:(MKMapView *)mapView
viewForAnnotation:(id<MKAnnotation>)annotation;
,我已经把这两行:
annotationView.canShowCallout = YES;
[(UIImageView *)annotationView.rightCalloutAccessoryView setImage: _image];
但仍然无法弄清楚如何在那里获取图像。
检查我的答案:http://stackoverflow.com/questions/4819006/iphone-sdk-mapkit-multiple-points-and-annotation/4826030#4826030 – HelmiB 2012-07-31 03:23:19