gpt4 book ai didi

ios - 导航栏是白色的,而 isTranslucent = false

转载 作者:可可西里 更新时间:2023-11-01 00:41:10 24 4
gpt4 key购买 nike

<分区>

我有一个主导航 Controller ,我在其中设置背景颜色

 override func viewDidLoad() {
super.viewDidLoad()

self.navigationBar.backgroundColor = UIColor.blue
self.navigationBar.isTranslucent = false
}

但是,在那种情况下,我的导航栏会变成全白的。当我将 isTranslucent 设置为 true 时,我的导航栏变得透明,但这并不是我真正需要的。我想要只有蓝色的导航栏。

以防万一在我的导航 Controller 中我过度了

override var preferredStatusBarStyle: UIStatusBarStyle{ return .lightContent }

并在 AppDelegate 中设置色调

UINavigationBar.appearance().tintColor = UIColor.white
UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName: UIColor.white]

评论 tintColor 也没有帮助我。

This is my "blue" navigation bar

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