I have a viewcontroller that it implement UITabbarViewController, and I want to hide the tab bar and override it by myself,
self.tabBar.hidden = YES;
the tab bar disappeared BUT there is a blank area(the blue one) at the bottom of the view. I dont want the blank area , how can I fix this? Thank you.
edit: the blue area is:
self.view.backgroundColor = [UIColor blueColor];
Hide Tabs Using F11 Shortcut Pressing the F11 button on your keyboard makes Google Chrome go into full-screen view. This, in turn, hides the address bar and all the tabs from the toolbar menu.
If you don't want that behavior, you should set hidesBottomBarWhenPushed to true where applicable. This will hide the tab bar along with any toolbars you had showing, but only when a view controller is pushed onto the navigation stack. This allows you to show the tab bar at first, then hide it when you need more room.
Simply, Go to ViewController (in StoryBoard) -> Attribute inspector -> Under 'View Controller' section select 'Hide Bottom Bar on Push' checkbox. This works like a charm.
Answer: Use self. tabBarController?. tabBar. hidden instead of hidesBottomBarWhenPushed in each view controller to manage whether the view controller should show a tab bar or not.
We've done exactly the same in our application. To hide the default TabBar, simply override the hidesBottomBarWhenPushed
method in your parent view controller (or in every view controller in your App)
#pragma mark - Overriden UIViewController methods - (BOOL)hidesBottomBarWhenPushed { return YES; }
EDIT: This value can also be set from Storyboard:
My UITabBarController
is housed within a container view. Checking "Hide Bottom Bar on Push" was not working for me. Instead I created a subclass of the tab bar controller and hid the tab bar programmatically.
class FooTabBar: UITabBarController { override func viewDidLayoutSubviews() { super.viewDidLayoutSubviews() self.tabBar.isHidden = true } }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With