views:

977

answers:

3

So it is very easy to hide the tabbar when you push a view controller onto the navigation controller stack:

uiViewController.hidesBottomBarWhenPushed = YES;

works just peachy.

Put let's say I want to push deeper into the stack and show it again?

Setting

 laterUIViewController.hidesBottomBarWhenPushed = NO;

on some later view controller doesn't make it reappear. It's still hidden.

A: 

Try un hidding it, so you tell it to hide, it hides, but then you tell it to not hide it (i dont know if it re shows it if you set this to no) but it looks like it isnt, either that or u are telling it to not hide when the view controller you want the bar in has been pushed already and it does not un hide the bar until the next view controller has been pushed, so you should try to set it as unhidden youself.

Daniel
+1  A: 

You could try subclassing UIViewController and overriding the

- (void)viewWillAppear:(BOOL)animated { self.hidesBottomBarWhenPushed = YES; }
- (void)viewWillDisappear:(BOOL)animated { self.hidesBottomBarWhenPushed = NO; }

And then using that subclass as the superclass of the view controller that you want to show the bottom bar.

Joe V
I got something like this to sort of work. The animation is wrong though when the view reappears.The view will appear was not respected when going back so I had to jump through a bunch of hoops to make back work.
Carl Coryell-Martin
A: 

This worked for me:

  • (void)viewWillAppear:(BOOL)animated { self.tabBarController.tabBar.hidden = YES; }
  • (void)viewWillDisappear:(BOOL)animated { self.tabBarController.tabBar.hidden = NO; }
Eran Talmor