【问题标题】:UINavigationBar alpha removedUINavigationBar alpha 已移除
【发布时间】:2013-10-15 13:05:44
【问题描述】:

我在我的viewDidLoad: 中设置了以下内容

self.navigationController.tabBarController.tabBar.tintColor = tintColor;
self.navigationController.tabBarController.tabBar.alpha = 0.7f;

我已经设置了 alpha,所以我的视图中的背景图像会渗出(给 UINavigationBar 一个更深的颜色)

但是,在 iOS7 中,当应用程序启动时代码工作正常,但是当我离开视图然后返回时,alpha 设置已经消失(我只剩下色调)。

它在 iOS6 上的模拟运行良好,但在 iOS7 中不行,这可能是由于 iOS7 新的UINavigationBar 功能而导致的设置冲突吗?

【问题讨论】:

    标签: objective-c xcode uinavigationcontroller uinavigationbar


    【解决方案1】:

    你可能想尝试这样的事情:

    [[UITabBar appearance] setTintColor:[UIColor redColor]];
    [[UITabBar appearance] setBarTintColor:[UIColor yellowColor]];
    

    这应该会改变 iOS 7 中标签栏的色调。

    这里还有一个链接,指向如何设置标签栏颜色的详细教程,还提供了一些源代码。

    https://www.captechconsulting.com/blog/steven-beyers/ios-7-tutorial-series-tint-color-and-easy-app-theming

    【讨论】:

    • 我刚刚开始走这条路,这似乎是我正在寻找的东西,我最初的问题是我试图创建一个 iOS 6(外观和感觉)应用程序。我已经冒险并立即将其更新到 iOS 7
    猜你喜欢
    • 1970-01-01
    • 2014-01-19
    • 1970-01-01
    • 2015-05-25
    • 1970-01-01
    • 2019-12-11
    • 1970-01-01
    • 1970-01-01
    • 2013-01-08
    相关资源
    最近更新 更多