How to hide parent tabbar when pushing controller in navigationController

后端 未结 8 650
耶瑟儿~
耶瑟儿~ 2020-12-14 07:06

I have an application with a tab bar controller and each view contains a navigation controller. My MainWindow looks as follows: Image here http://www.freeimagehosting.net/im

8条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-14 07:49

    for swift 3,write the same code by you unhide the tabbar before pushviewController code like below

       var frame = self.tabBarController?.tabBar.frame
        frame?.origin.y = self.view.frame.size.height - (frame?.size.height)!+112
        UIView.animate(withDuration: 0.2, animations: {
            self.tabBarController?.tabBar.frame = frame!
        })
        self.navigationController?.pushViewController(viewController, animated: true)
    

    or use just whant to unhide the tabbar u can use

      viewController.hidesBottomBarWhenPushed = false
    

提交回复
热议问题