gpt4 book ai didi

ios - 导航栏的 .isTranslucent 颜色的 RGB 等效颜色是什么?

转载 作者:行者123 更新时间:2023-11-29 05:56:42 25 4
gpt4 key购买 nike

enter image description here

导航栏有一个 .isTranslucent 属性,可以赋予其灰色背景色

navigationController?.navigationBar.isTranslucent = true

我希望我的整个 View Controller 能够匹配相同的颜色,而 .lightGray 不是。我尝试使用 View Controller View 的 .alpha.isOpaque 属性,但无法使其匹配。

有谁知道 rgb 颜色或其他方式让我的 View Controller 的 View 背景色与相同的半透明灰色相匹配?

override func viewDidLoad() {
super.viewDidLoad()

// I tried playing with different combinations of all of these in different ways

view.backgroundColor = .lightGray

view.alpha = .5

view.isOpaque = false
}

最佳答案

这会将 View 和导航栏设置为相同的颜色:

view.backgroundColor = UIColor(red   : 249.0/255.0,
green : 249.0/255.0,
blue : 249.0/255.0,
alpha : 1.0)

cap

接缝仍然存在。如果您想删除它:

navigationController?.navigationBar.shadowImage = UIImage()

关于ios - 导航栏的 .isTranslucent 颜色的 RGB 等效颜色是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55079945/

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