gpt4 book ai didi

ios - swift:酒吧里的颜色是灰色的

转载 作者:行者123 更新时间:2023-11-30 11:08:50 24 4
gpt4 key购买 nike

我有带有白色导航栏颜色的NavigationViewController。当我从 firstViewController 转到 secondViewController 时,我在导航栏中看到灰色。我想去掉这个灰色。如何解决?

firstViewController:

enter image description here

转到secondViewController:

enter image description here

第二个ViewController:

enter image description here

如何删除它:

enter image description here

我的代码:

override func viewDidLoad() {
super.viewDidLoad()

if #available(iOS 11.0, *) {
self.navigationController?.navigationBar.prefersLargeTitles = true
self.navigationItem.largeTitleDisplayMode = .always
self.navigationController?.navigationBar.shadowImage = UIImage()
self.navigationController?.navigationBar.backgroundColor = UIColor.white
} else {
// Fallback on earlier versions
}
}

最佳答案

您需要将 isTranslucent 属性设置为 true

  self.navigationController?.navigationBar.isTranslucent = true

关于ios - swift:酒吧里的颜色是灰色的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52406638/

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