简体   繁体   中英

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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