【发布时间】:2014-05-06 20:20:33
【问题描述】:
我正在为iOS 7.0+ 编写应用程序,我想使用新功能,女巫是:imageWithRenderingMode。我有一个带有此代码的地图注释:
-(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) 图标变为红色。
我试图在我的ViewController 中设置self.view.tintColor 和self.mapView.tintColor,但这也不起作用。如何将这个引脚变成红色?
【问题讨论】:
标签: ios objective-c uiimageview mkannotation mkannotationview