2

I have an MKPinAnnotationView which I have customized in the -(MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation method. In the method I have done the following:

MKPinAnnotationView *newAnn = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"pinAnn"];
newAnn.leftCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeInfoLight];

But this results in the info button being pushed into the top left corner of the call out. I then tried:

MKPinAnnotationView *newAnn = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"pinAnn"];
UIButton *left = [UIButton buttonWithType:UIButtonTypeInfoLight];
left.center = CGPointMake(left.center.x + 5, left.center.y - 5);
newAnn.leftCalloutAccessoryView = left;

But it does nothing. I'm on iOS 8 btw. I'm not sure if this happens on iOS 7.

Milo
  • 5,041
  • 7
  • 33
  • 59
  • This may help. http://stackoverflow.com/questions/25484608/ios-8-mkannotationview-rightcalloutaccessoryview-misaligned – Diesel Nov 19 '14 at 14:37

0 Answers0