使用UIImageRenderingModeAlwaysTemplate

时间:2015-07-09 14:49:53

标签: ios objective-c iphone uiimage

我有一个PNG图像,我在运行时重新着色:

logo.image = [[UIImage imageNamed:@"logo.png"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
logo.tintColor = [UIColor whiteColor];

我的iPhone 6,所有模拟器等都显示为白色;但它在iPhone 6+上的颜色略深一些。可能有一个我错过的原因吗?

这里是iPhone 6+的屏幕截图(所有导航项目都应该是白色的 - 就像其他所有设备一样)

6+ screenshot

1 个答案:

答案 0 :(得分:1)

enter image description here

  

除非您设置了,否则barTintColor默认为半透明   半透明属性为NO。

试试这个

self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
self.navigationController.navigationBar.translucent = NO;
相关问题