在推送的ViewController中隐藏TabBar的问题,TabBar在延迟一段时间后出现

问题描述 投票:0回答:3

TabBar没有隐藏在推送的ViewController中,我使用下面的代码来隐藏tabBar,

tabBarController?.tabBar.isHidden = true
                or
self.hidesBottomBarWhenPushed = true

但仍有一些延迟后tabBar出现。如果有人遇到这种问题,并能够解决它。你的答案将非常有帮助。

enter image description here

我在故事板上做过这个。

ios swift uitabbarcontroller ios11
3个回答
0
投票

如果要隐藏特定控制器上的tabor,可以执行以下操作:

controller.hidesBottomBarWhenPushed = true


0
投票

您需要做的只是选择要隐藏条形图的ViewController的“隐藏推送底栏”属性。请检查屏幕截图。注意:以编程方式编写“self.hidesBottomBarWhenPushed = true”有时对我不起作用。

enter image description here


0
投票

UITabBarController有属性hidesBottomBarWhenPushed所以你必须在你要推动的控制器上设置true

例如:

    //pushedVC - VC you try to push(the one where you don't want to show TabBar)
    pushedVC.hidesBottomBarWhenPushed = true
    navigationController?.pushViewController(pushedVC, animated: true)

要么

Storyboard中设置此项

enter image description here

Documentation

© www.soinside.com 2019 - 2024. All rights reserved.