5

Currently I'm working on the ios mkmapview to show some pois with pin added on the map, when user click the pin, the default callout will come up and show the title of the poi, but some of the titles are quite long and the callout is not wide enough to show the title completely. What I want is just make the callout wider, how can I do it? I searched for answers for hours but all are about implementing custom class for callout, is there any way to just re-size it without further implementing? Do I miss something obvious?

always_beta
  • 229
  • 4
  • 10

1 Answers1

0

Im doing almost something similar. Because i don't like the normal callout on the map I created a custom callout. Implement the MKMapViewDelegate in your header and declare the method (void)mapView:(MKMapView *)aMapView didSelectAnnotationView:(MKAnnotationView *)view in your implementation file. In this method i create a new view which displays the content of the annotation. Add a UIButton to close this custom view.

//deselect the selected annotation
- (void)deselectAnnotation {
    selectedAnnotation = mapView.selectedAnnotations;
    for (int i = 0;i < selectedAnnotation.count; i++) {
        [mapView deselectAnnotation:[selectedAnnotation objectAtIndex:i] animated:NO];
    }
}
Mark Molina
  • 5,057
  • 8
  • 41
  • 69