显示第一个VC后,我有了导航控制器。我正在使用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/