如何在RootView中隐藏TabBar ChildViewControllers

时间:2017-09-20 07:46:04

标签: ios objective-c iphone uitabbarcontroller uitabbar

我在 TabBar UITabBarController

中的隐藏ChildViewControllers中遇到麻烦

对于Ex。假设我的主屏幕中有两个标签栏项目,并且选择了第一个标签栏项目,我想使用导航第一个标签栏然后我想要隐藏 TabBar 在第一个 TabBar 项目childViewControllers

2 个答案:

答案 0 :(得分:1)

我找到了解决方案

 [self.tabBarController.tabBar setHidden:YES];

使用隐藏属性在viewDidLoad中使用hide标签栏项。 并在storyBoard ViewController中选择Under Opaque Bars选项。

答案 1 :(得分:1)

在推送或显示视图之前

。将检查viewcontroll上的hidesBottomBarWhenPushed变量并自动隐藏底栏。你可以用两种方式使用它:

1-在子控制器中覆盖它:

override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
    if segue.identifier == "identifier" {
        segue.destination.hidesBottomBarWhenPushed = true
    }
}

2-你可以在准备segue之前设置segue:

public function actionfuntion1
public function actionfuntion2