Hello there,
I'm trying to add a UILabel to an MKAnnotationView as a leftCalloutAccessoryView right after a pin got selected for the first time in the MKMapView. Adding the label is not a problem: The callout gets selected and opens, and this is when I add the label to the callout view. The callout gets automatically expanded to the left with a slide animation, and the new label including 2 lines is shown. Unfortunately I need to add the label after the Pin got selected because I need certain information about that Pin first.
The problem now is that the text in this label is somewhat "blurry", like it is not rendered correctly. When I deselect the callout and select it again, everything is drawn correctly.
This is the way I add the label:
During creation of the MKPinAnnotationView I register as an observer for the "selected" property of the view, since there is no delegate method for the selection of the pin. When the pin is selected in the view, my observer method fires and simply adds the text label to the view. (create UILabel with 2 lines, a clear background color and a bold white system font, set the leftCalloutAccessoryView, release the label). I tried setNeedsDisplay, setNeedsLayout and several other things, but no matter what, the text is still blurry in the label until the Pin is selected for the second time.
Any idea how I can get this Label to be drawn correctly without beeing blurry?
Thanks in advance!