Daniele
Daniele

Reputation: 122

Custom Map Annotation Callout image

I'm able to set the MKPinAnnotationView with title, subtitle, an image on the left (leftCalloutAccessoryView) and a button on the right (rightCalloutAccessoryView).

With this code i set the image on the left:


UIImageView *myImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Icon.png"]];
myImageView.frame = CGRectMake(0, 0, 10, 10);
customPinView.leftCalloutAccessoryView = myImageView;
[myImageView release], myImageView = nil;


The result is something like this:
Image 1

but I would like to get something like this:
Image 2 where the image is aligned with the subtitle.

How can get it?

Thx.

Upvotes: 0

Views: 1118

Answers (1)

Nick
Nick

Reputation: 8493

That's going to require using a custom annotationView. There's plenty of documentation about this in the developer resources. There's no way to do that image alignment using the default annotation style.

Upvotes: 1

Related Questions