问题
I am displaying a custom MKAnnotationView that when clicked displays a title. I know that I can use:
- (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view;
To detect the click on the annotation view. Once the user clicks on this AnnotationView a title pops up for the annotation. What I want to do is go to a new controller when the title is clicked. So my question is: Is there a way to detect a click on the title?
回答1:
In your custom MKAnnotationView simply override setSelected:animated:
to show a custom view instead of the built-in callout. What's in that view, and what happens when the user taps within it, is now up to you.
来源:https://stackoverflow.com/questions/26417110/in-ios-mapview-is-there-an-annotation-title-call-back-function-or-a-way-to-set