[英]Present view controller from UITabBarController without tab bar showing
I have read multiple answers regarding this issue. 我已阅读有关此问题的多个答案。 The main thing indicated is to set hidesBottomBarWhenPushed to true, which i have done and is still not working for me.
指示的主要内容是将hidesBottomBarWhenPushed设置为true,我已完成但仍无法使用。
So this is my storyboard layout. 这就是我的情节提要布局。
So i present a TableViewController from my TabBarController, the view i present is the bottom left on the storyboard. 所以我从我的TabBarController展示了一个TableViewController,我展示的视图是故事板上的左下角。 With hidesBottomBarWhenPushed set to true, i expect the bottom bar to be hidden but this is not the case.
将hidesBottomBarWhenPushed设置为true时,我希望底部栏被隐藏,但事实并非如此。 It actually adds a new bottom bar and upon navigating back to the tab view a new tab bar is overlapping the original one.
它实际上添加了一个新的底部栏,并导航回到选项卡视图时,新的选项卡栏与原始选项卡栏重叠。 You can see this in the screenshots below.
您可以在下面的屏幕截图中看到它。
So firstly the tab bar, we then select the filter icon on the top right, which triggers the segue to the next controller. 因此,首先是标签栏,然后选择右上角的过滤器图标,这会触发到下一个控制器的搜索。
So now the next controller loads in. As you can see the tab bar is displayed even though i have set hidesBottomBarWhenPushed on the storyboard. 因此,现在将加载下一个控制器。您可以看到,即使我在情节提要板上设置了hidesBottomBarWhenPushed,也会显示选项卡栏。
And now when we navigate back there is a new tab bar overlapping the original. 现在,当我们向后浏览时,有一个新的标签栏与原始标签栏重叠。
I don't have much experience with tab bar controllers, have i done something wrong with my storyboard hierarchy maybe. 我没有使用标签栏控制器的丰富经验,也许我的情节提要层次结构做错了什么。 Perhaps each tab should have its own navigation controller.
也许每个选项卡都应该有自己的导航控制器。 However my tab bar also needs a navigation controller.
但是,我的标签栏也需要导航控制器。
Any help or suggestions is greatly appreciated. 任何帮助或建议,我们将不胜感激。
In viewDidLoad
of tableVC 在tableVC的
viewDidLoad
中
self.tabBarController?.tabBar.isHidden = true
In viewWillAppear
of the VC before the tableVC 在
viewWillAppear
中,VC在tableVC之前
self.tabBarController?.tabBar.isHidden = false
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.