0

I have MKmapview with an annotation, then if I push or click a pin of annotation,it will show a CallOut such as title or subtitle. but I want to customize it and input an event, such as if I click a CallOut, I will be threw to another view. what should I do? any code to make an event if CallOut was clicked?

how to customize CallOut Bubble?

user4951
  • 32,206
  • 53
  • 172
  • 282

1 Answers1

0

You have several options:

  1. You can assign leftCalloutAccessoryView and/or rightCalloutAccessoryView properties for your annotation's view - for example use a button there with appropriate action

  2. When user taps annotation callout then annotation gets deselected and you can handle that event in map view's delegate mapView:didDeselectAnnotationView: method

  3. You can try to create you custom callout with whatever behaviour you want. There're several blog posts in the web with examples how to do that (e.g. #1, #2)

Vladimir
  • 170,431
  • 36
  • 387
  • 313
  • mapView:didDeselectAnnotationView: works when we click the annotation not when we click the bubble. – user4951 Jul 05 '11 at 09:13
  • @Jim Thio, just checked in my project - diddeselect method gets called when we tap callout... (tested on iPad simulator v4.3) – Vladimir Jul 05 '11 at 09:36