UINavigationController without navigation bar?

后端 未结 6 1703
小蘑菇
小蘑菇 2020-12-07 15:01

I have a universal app, and on the iPad version I\'m using UISplitViewController to create an interface similar to the Mail app.

I was having trouble pu

6条回答
  •  鱼传尺愫
    2020-12-07 15:49

    Swift 4

    I hide it in viewWillAppear

         override func viewWillAppear(_ animated: Bool) {
            super.viewWillAppear(animated)
    
            self.navigationController?.isNavigationBarHidden = true;
        }
    

    Then you can put it back when you push a segue (if you want to have the back button on the next view)

         override func prepare(for segue: UIStoryboardSegue, sender: Any?) 
         {
            self.navigationController?.isNavigationBarHidden = false;
         }
    

提交回复
热议问题