简体   繁体   English

如何将NavigationBar改回不透明?

[英]How to turn navigationBar back to nontransparent?

How do I change the navigationBar back to nontransparent in one view after I have made it transparent with this piece of code in AppDelegate.swift : 使用AppDelegate.swift这段代码使其透明后,如何在一个视图中将navigationBar更改回非透明:

self.navigationBar.setBackgroundImage(UIImage(), forBarMetrics: UIBarMetrics.Default)
self.navigationBar.shadowImage = UIImage()
self.navigationBar.translucent = true

have you tried: 你有没有尝试过:

self.navigationBar.setBackgroundImage(nil, forBarMetrics: UIBarMetrics.Default)
self.navigationBar.shadowImage = nil  
// or
self.navigationBar.barStyle = UIBarStyle.Default 

and of course: 而且当然:

self.navigationBar.translucent = **false**

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

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