0

Just as the title says, I have a UINavigationController nested in a UITabBarController. When the user taps on a table cell, I would like to push a view controller (which doesn't show the UITabBar). This is the behavior of the iPod app when you tap on "Now Playing."

How can this be done?

Keller
  • 17,051
  • 8
  • 55
  • 72

4 Answers4

1

Just add this in the view controller you are pushing.

- (BOOL)hidesBottomBarWhenPushed {
    return YES;
}
rushafi
  • 863
  • 10
  • 19
0

For example:

    OrderViewController *controller = [[OrderViewController alloc] init];
    controller.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
    [self presentModalViewController:controller animated:YES];
    [controller release];

Or try to set property hidesBottomBarWhenPushed of self.tabBarController to YES.

Nekto
  • 17,837
  • 1
  • 55
  • 65
0

Start with a UITabBarController project in Xcode, place a UINavigationController in each one of the tab view for the controller, and you're done! Hope that Helps!

msgambel
  • 7,320
  • 4
  • 46
  • 62
0

I think hidesBottomBarWhenPushed is the way to go. There's some gotchas to keep in mind. Your setting this on the UIViewController that you're pushing, not on the tabBarController, or on the existing navigation controller.

Check here for more details: Setting hidesBottomBarWhenPushed leaves bottom bar missing after View Controller is popped

From that post, some sample code:

self.anotherViewController.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:self.anotherViewController animated:animated];
Community
  • 1
  • 1
kris
  • 2,516
  • 25
  • 29