MKMapView annotation image changes to pin on click
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
精彩评论