简体   繁体   English

来自UITabBarController的当前视图控制器,未显示选项卡栏

[英]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.

相关问题 从UITabBarController以模态方式呈现ViewController而不隐藏选项卡栏 - Present ViewController modally from UITabBarController without hiding the tab bar 如何在没有视图控制器的情况下将标签栏项添加到UITabBarController? - How to add a tab bar item to UITabBarController without a view controller? 从标签栏控制器以模态方式呈现视图 - Present a View modally from a tab bar controller 从UITabBarController选项卡根视图中显示UINavigationController - Present UINavigationController from UITabBarController tab root view 如何从UI视图控制器显示选项卡栏控制器 - How to present a Tab Bar Controller from a UI View Controller 从选项卡栏控制器以模态方式呈现视图控制器 - Present a View Controller modally from a tab bar controller 如何通过标签栏按钮显示视图控制器 - How to present a view controller from tab bar button 当推入我的UITabBarController时,视图控制器隐藏的选项卡栏 - Tab bar hidden by view controller when pushed inside my UITabBarController 将UINavigationController添加到UITabBarController,而不显示所有视图中的Tab Bar - Add UINavigationController to UITabBarController without Tab Bar showing up in all views 将控制器添加到UITabBarController,而标签栏中没有出现新项目 - Add controller to UITabBarController without new item appearing in the tab bar
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM