Navigation bar not showing iOS swift

前端 未结 7 1468
醉话见心
醉话见心 2021-02-18 13:24

I am having multiple view controller in my application. I want to hide navigationbar in my first view controller. So I use the following code to hide the navigation

7条回答
  •  -上瘾入骨i
    2021-02-18 13:53

    in viewDidLoad method of the view controller in which you don't want to show navigation bar add the line

    navigationController.navigationBarHidden = true
    

    you are presently hiding in all view controllers

    Edit: You are presenting view controller instead it should be

    self.navigationController!.pushViewController(controller) 
    

提交回复
热议问题