ios - MKMapView 注释图像更改为单击时固定

标签 ios annotations mkmapview

我是我的 iPhone map View 应用程序,当我单击注释图像时,它会变成图钉。谁能告诉我如何纠正它?

我的想法是显示图像而不是自定义图钉,即使它被单击。

最佳答案

当您单击注释时,将调用此委托(delegate)

- (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view
{
//I think here you will be adding a annotation(my assumption)
[mapView addAnnotation:yourAnnotation];
//This will call viewForAnnotation again
}


- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation
{
//If you didnt specify the a image for the annotation the default pin image will be assigned here..
}

如果我的假设是错误的,那么在这里发布你的代码相关注释,这样你就可以获得更好的答案

关于ios - MKMapView 注释图像更改为单击时固定,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4966796/

相关文章:

ios - 语言改变了但 CLLocationManager 没有受到影响?

ios - 当在其中一个页面中包含的 UISwitch 上开始触摸时禁用 UIPageViewController 滚动

ios - UITextView:背景颜色,同时保持左/右段落缩进

ios - 如何在 MapView 注释中将右访问器的框架调整到右上角?

objective-c - 如何更正 "Undefined symbols for architecture i386: "_main"链接问题?

java - 在 Spring 中继续获取 java.lang.NoClassDefFoundError

java - 如何从 Java 中的常量向注解提供枚举值

ios - 通过两点之间的距离设置区域

uitableview - 在 UITableViewController 的每个单元格中,我都嵌入了 map 。有没有办法将其更改为 map 的屏幕截图?

java - Spring 3.1.0 mvc 绑定(bind) modelattribute 以及 requestbody