4

I have a navigation controller in a tab bar controller. When I push a new view controller I want to show the toolbar. I'm doing that like this from the pushed view controller.

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [self.navigationController setToolbarHidden:NO animated:NO];
}

This works but the toolbar slides up from it's normal position where the tab bar is to go above it. I want it to appear without this "slide up" animation above the tab bar. Is that possible?

Here is my setup. The "slide up" animation occurs when pushing from view controller 1 to view controller 2. I only want the toolbar to appear in view controller 2.

[Tab Bar Controller]
  - [Navigation Controller]
     - [View Controller 1] -> Push -> [View Controller 2]
Berry Blue
  • 15,330
  • 18
  • 62
  • 113

4 Answers4

2

Put your navigation controller embedded inside in your tab bar controller instead of the other way around.

So the tab bar will have the Nav bar as one of its view controllers

Tomer Even
  • 4,820
  • 2
  • 30
  • 36
2

Make sure that in the storyboard all the view controllers have the "hide bottom bar" property unchecked

enter image description here

Tomer Even
  • 4,820
  • 2
  • 30
  • 36
2

Have you tried destinationVC.hidesBottomBarWhenPushed = YES;?

Apple docs

tommybananas
  • 5,718
  • 1
  • 28
  • 48
  • Thanks for your response. That does work to remove the animation but I want both the tab bar and toolbar visible. – Berry Blue Mar 21 '16 at 15:59
2

Move [self.navigationController setToolbarHidden:NO animated:NO]; from viewWillAppearto viewDidloadthat should work.

aman.sood
  • 872
  • 7
  • 19