1
votes

I am having some trouble hiding toolbar (Bottom bar) on one of the view controllers in my iOS app. So I have a home view controller which has a navigation bar and a toolbar. Then a UIPageViewController is pushed (a tutorial for the app). There should be no navigation or toolbar on this screen.

I used the standard code to hide the toolbar. Here it is:

self.navigationController.toolbarHidden = YES;

It works in iOS 8 but not in iOS 7. I tried many variations and tried putting it in viewDidLayoutSubviews, viewWillAppear, viewDidappear and also right before pushing the view controller. Nothing works. Hiding navigation bar worked without issues.

Any help is much appreciated.

1
Just to clarify, do you have a UIToolBar at the bottom of your home view controller or is it a UITabBar?Acey
UIToolBar of the navigation controller.anivader
Are you using a storyboard to set up the navigation controller, toolbar, and the home view controller? Can you post a screenshot?Acey
No I am just using code to set everything up. I'm sure the code is working because it behaves as expected on iOS 8 + the code works for all other screens in the app for both iOS 7 and 8 + believe it or not, when I ran it this afternoon it suddenly started working but after a while it stopped working again.anivader

1 Answers

0
votes

A better property to use when you want the toolbar hidden when pushing is setting hidesBottomBarWhenPushed to YES on the UIViewController you are pushing.