在显示第一个 VC 后,我有了导航 Controller 。我正在使用 perform segue 通过 performSegue(withIdentifier: "secondVC", sender: nil)
从第一个 vc 导航到第二个页面,我的边栏出现了。但是,当我尝试从 First vc 转到第三页时,它没有导航。所以,我尝试使用以下代码
let thirdVC = self.storyboard?.instantiateViewController(withIdentifier: "thirdVC") as! ThirdVC
navigationController?.pushViewController(thirdVC, animated: true)
它工作正常,但当我使用上面的代码时,我的导航栏消失了。我怎样才能从第一个 vc 到第三个?
最佳答案
你可以试试这个
let thirdVC = self.storyboard?.instantiateViewController(withIdentifier: "thirdVC") as! ThirdVC
navigationController?.isNavigationBarHidden = false
//Make sure navigation controller should be there
navigationController?.pushViewController(thirdVC, animated: true)
关于ios - 导航 Controller 无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48865851/