gpt4 book ai didi

ios - navigationBar.barTintColor 始终为黑色且无法更改

转载 作者:塔克拉玛干 更新时间:2023-11-02 10:05:46 28 4
gpt4 key购买 nike

我的应用程序中的 navigationBar.barTintColor 始终是黑色的,我无法更改它。我检查了所有类,但从未将其设置为黑色,但我确实将其设置为 UIColor clearColor。不过,酒吧是黑色的。有什么建议吗?

编辑:
我发现问题出在我的[UIColor clearColor]上,当我将它更改为任何其他颜色时,它会更改颜色就像它应该的那样,但是 clearColor 让它看起来是黑色的。

最佳答案

看看那里

enter image description here

尝试修改导航栏(图片右上角)上的 StyleTranslucent 属性。

如果您在修改状态栏颜色时遇到问题,请尝试将其添加到您的 .plist(下一行)。

enter image description here

<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>

最后,这里有一些您可能需要的代码。

// Status bar color
[[UIApplication sharedApplication] setStatusBarStyle:yourStyle];

// Navigation bars color
[UINavigationBar appearance].barStyle = yourStyle;
[UINavigationBar appearance].barTintColor = [UIColor yourColor];

// Navigation bars items color
[UINavigationBar appearance].tintColor = [UIColor yourColor];

关于ios - navigationBar.barTintColor 始终为黑色且无法更改,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22838652/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com