简体   繁体   中英

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.

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. With hidesBottomBarWhenPushed set to true, i expect the bottom bar to be hidden but this is not the case. 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.

在此处输入图片说明

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

self.tabBarController?.tabBar.isHidden = true

In viewWillAppear of the VC before the tableVC

self.tabBarController?.tabBar.isHidden = false

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM