开发者

MKMapView annotation image changes to pin on click

开发者 https://www.devze.com 2023-02-10 02:17 出处:网络
Im my iphone ma开发者_JAVA百科pview application when i click on the annotation images it get change into pin. Can anyone please tell me how can i correct it?

Im my iphone ma开发者_JAVA百科pview application when i click on the annotation images it get change into 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

0

精彩评论

暂无评论...
验证码 换一张
取 消