简体   繁体   English

MKMapView批注图像更改为单击即可固定

[英]MKMapView annotation image changes to pin on click

Im my iphone mapview application when i click on the annotation images it get change into pin. 我在我的iphone mapview应用程序上单击注解图像,将其更改为pin。 Can anyone please tell me how can i correct it? 谁能告诉我如何纠正它?

My idea is to display a image instead of custom pin, even though it is clicked. 我的想法是显示图像而不是自定义图钉,即使单击它也是如此。

When you click on a annotation this delegate will be called 当您单击注释时,该委托将被称为

- (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..
}

If my assumption is wrong then post your code here related annotations, So you can get better answers 如果我的假设是错误的,那么将您的代码发布在此处相关的注释中,这样您就可以获得更好的答案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM