iOS7中奇怪的UITabBar颜色不一致 [英] weird UITabBar color inconsistency in iOS7
问题描述
我正在使用iOS 7的 tintColor
和 barTintColor
属性来为我的 UITabBar着色
在UITabBarController的子类中使用此代码:
I'm using iOS 7's tintColor
and barTintColor
properties to color my UITabBar
with this code in a subclass of UITabBarController:
[[UITabBar appearance] setBarTintColor:[UIColor colorWithRed:123/255.0 green:47/255.0 blue:85/255.0 alpha:1]];
[[UITabBar appearance] setTintColor:[UIColor colorWithRed:227/255.0 green:180/255.0 blue:204/255.0 alpha:1]];
在三个屏幕上,颜色是我想要的颜色(只有两个图像说明了这一点):
On three screens, the color is what I want it to be (only two images illustrating this):
一个屏幕,颜色非常轻。此屏幕是 UIWebView
。
One one screen, the color is weirdly lighter. This screen is a UIWebView
.
然后在第四个屏幕上,颜色为SUPER-light。这个屏幕是唯一一个使用故事板的人 - 其余的都是以编程方式完成的。
Then on a fourth screen, the color is SUPER-light. This screen is the only one to use a storyboard--the rest are all done programmatically.
我做错了什么?事实上,行为不当的屏幕是 UIWebView
,故事板与他们行为不端的原因有什么关系?我该如何解决它们?我已经摆弄了酒吧的阿尔法,但它并没有改变任何东西。
What am I doing wrong? Do the fact that the misbehaving screens are a UIWebView
and a storyboard have anything to do with why they're misbehaving? And how do I fix them? I've fiddled with the alpha of the bar but it doesn't change anything.
感谢您的帮助。
推荐答案
您正在看标签酒吧半透明...即背景视图正在渗透和模糊。如果你想禁用它,你可以这样做:
You're seeing tab bar translucency...i.e. the background view is bleeding through and being blurred. If you want to disable this, you can do:
[tabBar setTranslucent:NO]
在标签栏上。
在你的前两张图片中,它不清楚对我来说,如果基础视图控制器视图是边对边的,即你的前两个图像应该看起来像第四个,因为它们都是粉红色背景。无论如何,setTranslucent:NO应该让它们看起来像顶部图像。
On your top two images, its not clear to me if the underlying view controller view is edge-to-edge, i.e. your top two images should look like the fourth one since both have pink backgrounds. Anyhow, setTranslucent:NO should make them all look like the top image.
这篇关于iOS7中奇怪的UITabBar颜色不一致的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!