0

In most part of my iPhone application I want to show things with navigation controller and tab bar. But for few screens I need more space so I want to remove the tab bar.

I found before calling the controller that doesn’t need the tab bar I can set to hide it,

CardImageViewController *cardImage = [[CardImageViewController alloc] 
initWithNibName:@"CardImageViewController" bundle:nil];

cardImage.hidesBottomBarWhenPushed = YES;

[self.navigationController pushViewController:cardImage animated:YES];
[cardImage release];

The problem is now I can’t get it to display again. If I set

xxx.hidesBottomBarWhenPushed = NO;

for the next controller still I can’t see the tab bar

How do I get it to display.

Janaka
  • 2,505
  • 4
  • 33
  • 57
  • This answer to a similar question appears to do the trick: http://stackoverflow.com/questions/1356828/show-hide-tabbarcontroller-in-iphone/2025749#2025749 – Matthew Frederick Jan 28 '11 at 06:05

2 Answers2

0

The bar will remain hidden until you pop that controller that you hide off the navigation stack.

Refer to: http://developer.apple.com/library/ios/#documentation/uikit/reference/UIViewController_Class/Reference/Reference.html

One way to solve this is to present modal view for those controllers that you want to hide the tab bar

Seyther
  • 652
  • 4
  • 6
0

In which view you want tab Bar hide use

cardImage.hidesBottomBarWhenPushed = YES;

this before push

and now in viewWillDisAppear of same view you need

cardImage.hidesBottomBarWhenPushed = NO;

Ishu
  • 12,797
  • 5
  • 35
  • 51
  • This work very well for a one-view controller. In my case several views that I need to hide more than 1 tab bar (1st view – tab bar), (2nd view – no tab bar), (3rd view – no tab bar), (4th view – tab bar), is there a way to skip multiple views – Janaka Jan 28 '11 at 08:48
  • If I used the navigation controller back button to go back, then tab bar will gain appear in the 2nd view controller, which we hide before – Janaka Jan 28 '11 at 09:08