[英]Issue with navigation Bar when switching back to root View controller
I want my app to go back to main root view controller on button click, but when i press the button it goes but the navigation bar is disappeared. 我希望我的应用程序在单击按钮时返回主根视图控制器,但是当我按下按钮时它消失了,但是导航栏消失了。 I have tried different solutions but no luck. 我尝试了不同的解决方案,但没有运气。
Try this: In your Root View Controller, add this code: 尝试以下操作:在您的Root View Controller中,添加以下代码:
override func viewWillAppear(animated: Bool) {
self.navigationController?.navigationBarHidden = false
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.