Reputation: 12174
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:
Here is how I want to make it look like:
Upvotes: 2
Views: 5767
Reputation: 3635
On iOS7, you can use the tintColor property on the mapView to change the color of the disclosurebutton.
Upvotes: 3
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