- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
导航栏有一个 .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)
接缝仍然存在。如果您想删除它:
navigationController?.navigationBar.shadowImage = UIImage()
关于ios - 导航栏的 .isTranslucent 颜色的 RGB 等效颜色是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55079945/
我目前设置了一个项目,在注册期间我使用 UINavigationController 来管理 View Controller ,作为设计的一部分,我使用以下代码将 UINavigationBar 设置
我遇到了一些非常奇怪的事情。如果我的 UITTabBar isTranslucent 属性设置为 false,它会添加这个奇怪的双像(或 View ?我不知道是什么它确实位于 UITabBar 之上。
这个问题在这里已经有了答案: Changing navigation bar color in Swift (36 个答案) 关闭 5 年前。 我有一个主导航 Controller ,我在其中设置背
导航栏有一个 .isTranslucent 属性,可以赋予其灰色背景色 navigationController?.navigationBar.isTranslucent = true 我希望我的整个
我发现了 navigationController.navigationBar.isOpaque 和 navigationController.navigationBar.isTranslucent
lazy var navigationBar = UINavigationBar(frame: CGRect(x: 0, y: 20, width: screen_width, height: 44)
我有一个带有搜索栏的表格 View 。但是,当我单击搜索栏时,导航栏似乎会展开并在其下方创建一个空白区域。但是,这只发生在 self.navigationController?.navigationB
我有以下简单案例: 一个 UINavigationController,带有一个 Root View Controller ,其中包含一个横跨整个 View 的 tableView,然后是底部的一个
我是一名优秀的程序员,十分优秀!