hide / show tab bar when push / back. swift

前端 未结 4 2064
甜味超标
甜味超标 2020-12-05 16:46

Answer: Use self.tabBarController?.tabBar.hidden instead of hidesBottomBarWhenPushed in each view controller to manage whether the view controller should show a tab

4条回答
  •  有刺的猬
    2020-12-05 17:19

    Add hidesBottomBarWhenPushed property to destination view controller, and set to true.

    Example with push VC with identifier:

        let storyboard = UIStoryboard(name: STORYBOARD_NAME, bundle: nil)
        let vc = storyboard.instantiateViewController(withIdentifier: VC_IDENTIFIER) as! YourViewController
        vc.hidesBottomBarWhenPushed = true
        navigationController?.pushViewController(vc, animated: true)
    

提交回复
热议问题