Hiding Uitabbar When Pushing a Uiview

Hiding UITabBar when pushing a UIView

This is better:

viewController.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:viewController animated:YES];

You have to set hidesBottomBarWhenPushed = YES on the controller you are going to push into the view...

Hide UITabBar when pushed while retaining touch

You need to make sure that you are setting the springs and struts of your table view correctly:

springs and struts

hide / show tab bar when push / back. swift

As it's name suggest, hiddenBottomBarWhenPushed only hide bottom bar if needed, it will not unhide bottomBar.
You can do this to get it works:

override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
self.tabBarController?.tabBar.hidden = true/false
}

or simply put self.tabBarController?.tabBar.hidden = true/false in prepareForSegue

But I would not recommend you to do so, as it would be weird if bottomBar suddenly popped out, user will thought they suddenly back to rootViewController while they are not.

Users should always know where they are in your app and how to get to their next destination.

Hiding the tabbar and removing the space

If you're still seeing a black stripe under your hidden tab bar, have you tried to select Extend Edges Under Opaque Bars here?

Sample Image

Make also sure that Under Bottom Bars is still selected. Hope it helps!

How to hide UITabBar?

You have to use set the hidesBottomBarWhenPushed property to YES on the controller that you are pushing and NOT to the UITabBarController.

otherController.hidesBottomBarWhenPushed = YES;
[navigationController pushViewController: otherController animated: TRUE];

Or you can set the property when you first initialize the controller you want to push.

How to hide parent tabbar when pushing controller in navigationController

After spending hours and posting a question here I found that the solution to this problem is adding the following line after the instantiation of ArticleController.

articleController.hidesBottomBarWhenPushed = YES;

How to hide tabbar

Set hidesBottomBarWhenPushed to YES on your UIViewController.

How to hide uitabbarcontroller

I am pasting this from my working code... you can call these methods to hide and show the tabbarcontroller.... just pass tabbarcontroller instance to these functions..

// Method call
[self hideTabBar:self.tabBarController];

// Method implementations
- (void)hideTabBar:(UITabBarController *) tabbarcontroller
{
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];

for(UIView *view in tabbarcontroller.view.subviews)
{
if([view isKindOfClass:[UITabBar class]])
{
[view setFrame:CGRectMake(view.frame.origin.x, 480, view.frame.size.width, view.frame.size.height)];
}
else
{
[view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, 480)];
}
}

[UIView commitAnimations];
}

- (void)showTabBar:(UITabBarController *) tabbarcontroller
{
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];
for(UIView *view in tabbarcontroller.view.subviews)
{
NSLog(@"%@", view);

if([view isKindOfClass:[UITabBar class]])
{
[view setFrame:CGRectMake(view.frame.origin.x, 431, view.frame.size.width, view.frame.size.height)];

}
else
{
[view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, 431)];
}
}

[UIView commitAnimations];
}

How to hide TabBar from UITabBarController when any other UIViewController is pushed to stack

To hide tabbar controller in your ChildViewController :

  • If you are using Storyboard than simply go select that childViewController on which you need to hide the Tabbar & go to inspector on right panel. Set the Bottombar to none. (It will be Inferred By default (See Screenshot))

Sample Image

  • If you do so there is nothing you needs to write into the code. It will work automatically.

Hope this helps to everyone.

Hide tab bar in IOS swift app

You can simply use this in your ViewDidLoad() method.

self.tabBarController?.tabBar.hidden = true

For Swift 3.0, 4.0, 5.0:

self.tabBarController?.tabBar.isHidden = true

Or you can change z position of tab bar this way:

self.tabBarController?.tabBar.layer.zPosition = -1

and if you want to show it again then:

self.tabBarController?.tabBar.layer.zPosition = 0


Related Topics



Leave a reply



Submit