如何去除导航栏模糊效果 - swift

how to remove navigationbar blur effect - swift

我在网上搜索了很多但没有找到解决问题的方法,我不希望导航栏像屏幕截图那样模糊

导航栏的颜色与其他颜色不匹配,即使我对两者都使用了 sam 十六进制值。我想修理它。请帮忙

这是我用来给导航栏上色的代码

 let navigationBarAppearace = UINavigationBar.appearance()
    navigationBarAppearace.tintColor = UIColor.white
    navigationBarAppearace.barTintColor = UIColor(red: 204/255.0, green: 51/255.0, blue: 51/255.0, alpha: 1.0)

您看到的实际上并不是模糊效果,而是UINavigationBar半透明风格。如果你不想要 translucent 栏,将其 isTranslucent 属性 设置为 false

UINavigationBar.appearance().isTranslucent = false

使用:

navigationController.navigationBar.isTranslucent = 假