Amogh Talpallikar
Amogh Talpallikar

Reputation: 12174

How to change the callout bubble color in MapView annotation?

I want to be able to display a bluish bubble(default one is black) for callout for an annotation.

Wherever I search I only get samples to implement viewForAnnotation delegate method, but that only changes the annotationView not the bubble at the top.

However I wanted the pinColor to be green so I did override this method and here is the code. Can I do something else to provide a backgroundImage for callOut or change the tintColor for it ?

-(MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation
{
    MKPinAnnotationView *annView=[[[MKPinAnnotationView alloc]
                                  initWithAnnotation:annotation reuseIdentifier:@"pin"] autorelease];
    annView.pinColor = MKPinAnnotationColorGreen;
    [annView setEnabled:YES];
    [annView setCanShowCallout:YES];

    return annView;

}

Here is how it looks right now:

enter image description here

Here is how I want to make it look like:

enter image description here

Upvotes: 2

Views: 5767

Answers (2)

Rick Pastoor
Rick Pastoor

Reputation: 3635

On iOS7, you can use the tintColor property on the mapView to change the color of the disclosurebutton.

Upvotes: 3

Dunes Buggy
Dunes Buggy

Reputation: 1819

You can use custom annotation, as described at http://blog.asynchrony.com/2010/09/building-custom-map-annotation-callouts-part-2/

Upvotes: 1

Related Questions