I'm writing an application for iOS 7.0+
and I wanted to use new feature witch is: imageWithRenderingMode
. I have a map annotation with this code:
-(MKAnnotationView*)annotationView {
MKAnnotationView *annotationView = [[MKAnnotationView alloc] initWithAnnotation:self reuseIdentifier:@"AnnotationIdentifier"];
annotationView.enabled = YES;
annotationView.canShowCallout = YES;
annotationView.image = [[UIImage imageNamed:@"star"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
annotationView.rightCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
annotationView.tintColor = [UIColor redColor];
return annotationView;
}
I was expected that my pins will be red, but stays black, only the callout (i) icon turns red.
I was trying to set self.view.tintColor
and self.mapView.tintColor
in my ViewController
but this not working either. How to turns this pins red?