简体   繁体   English

SwiftUI 导航栏颜色

[英]SwiftUI Navigation Bar Color

I am trying to remove the translucent color of navigation bar in SwiftUI .我正在尝试删除SwiftUI中导航栏的半透明颜色。

在此处输入图片说明

In the picture you can see, that the color of nav bar is not the same like below.在图片中您可以看到,导航栏的颜色与下图不同。
How is it possible, that the navigation bar has the same color?导航栏怎么可能有相同的颜色?

Try adding these to your init() modifiers:尝试将这些添加到您的 init() 修饰符中:

UINavigationBar.appearance().barTintColor = .clear
UINavigationBar.appearance().setBackgroundImage(UIImage()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM