Resize iOS MapView

I'm currently working on ios mkmapview to show some pois with a pin added on the map, when the user clicks on the pin, the default leader is called and shows the name poi, but some of the names are quite long and the leader is not wide enough to show completely title. What I want is just to make the nameplate wider, how can I do it? I searched for answers for several hours, but all about implementing a custom class for a leader, is there a way to just resize without further implementation? Skip something obvious?

+5
source share
1 answer

I do almost something similar. Since I don't like the normal callout on the map, I created a custom callout. Put MKMapViewDelegate in your header and declare the method (void)mapView:(MKMapView *)aMapView didSelectAnnotationView:(MKAnnotationView *)viewin the implementation file. In this method, I create a new view that displays the contents of the annotation. Add 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];
    }
}
0
source

All Articles