如何巩固iPhone 5S和5之间的导航栏的半透明度? [英] How to consolidating the translucency of the navigation bar between iPhone 5S and 5?

查看:168
本文介绍了如何巩固iPhone 5S和5之间的导航栏的半透明度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法在iPhone 5和5S之间整合UINavigationBar的barTintColor。我的手机都在iOS 7.在下面的截图中,顶部是5S,底部是5. iPhone 5S显示一个非常半透明的效果,而iPhone 5显示更加微妙的效果。

I have difficulty consolidating the UINavigationBar's barTintColor between iPhone 5 and 5S. Both of my phones are on iOS 7. In the following screenshot, the top is 5S and the bottom is 5. iPhone 5S shows an extremely translucent effect while iPhone 5 shows a much more subtle effect. Only very dark objects are visible behind the navigation bar for iPhone 5.

[[UINavigationBar appearanceWhenContainedIn:[UINavigationController class], nil]
    setBarTintColor:[UIColor 
        colorWithRed:46.0 / 255.0 
        green:160.0 / 255.0 
        blue:152.0 / 255.0 
        alpha:0.8
    ]
];

我更喜欢两个手机看起来像iPhone 5.如果我把barTintColor的alpha增加到1.0,iPhone 5的导航栏将变得完全不透明。这是预期的结果。虽然iPhone 5S的酒吧会变得不那么半透明,效果仍然太强烈。

I would prefer that both phones look like the iPhone 5. If I were to increase the alpha of the barTintColor to 1.0, iPhone 5's navigation bar would become completely opaque. This is the expected result. Although iPhone 5S's bar would become less translucent, the effect is still too strong. How would I decrease the translucency even more, without making it completely opaque?

推荐答案

如同在注释中所讨论的,你会看到不同的因为其中一个设备使用的是过期的iOS 7版本。苹果在版本7.0.3的变化,以处理条色调的颜色,现在的alpha值被考虑。您应该专注于较新版本的iOS。

As discussed in the comments, you are seeing different behaviors because one of the devices is using an outdate iOS 7 version. Apple made changes in version 7.0.3 to the way bar tint color is processed, and now the alpha value is taken into account. You should focus on the newer version of iOS.

这篇关于如何巩固iPhone 5S和5之间的导航栏的半透明度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆