How do I hide/show tabBar when tapped using Swift in iOS8

后端 未结 10 1052
终归单人心
终归单人心 2020-12-04 12:44

I am trying to mimic the UINavigationController\'s new hidesBarsOnTap with a tab bar. I have seen many answers to this that either point to setting the hi

10条回答
  •  生来不讨喜
    2020-12-04 13:15

    Swift 5

    To hide

      override func viewWillAppear(_ animated: Bool) {
         self.tabBarController?.tabBar.isHidden = true
       }
    

    To show again

       override func viewDidDisappear(_ animated: Bool) {
        self.tabBarController?.tabBar.isHidden = false
      }
    

提交回复
热议问题