I have view controllers in a navigation controller (root: RootViewController
, second: ReadingViewController
), but in the second view controller I want to disable the navigation bar for a UIToolBar
(as I don't need the title and want more buttons, like in iBooks or the Facebook app). Problem is, when I hide the navigation bar in the second view, it appears randomly for a second again when I pop the view controller (go back).
When I pop the view controller the back button appears for a second:
In the second view controller I hide the nav bar in viewWillAppear:
:
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:YES animated:YES];
}
Also in the second view controller, I restore the nav bar in viewWillDisappear:
:
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
// ... other stuff
[self.navigationController setNavigationBarHidden:NO animated:YES];
}
I'm wondering how I combat this issue so that the view controllers transition seamlessly.
[UINavigationItem leftBarButtonItems]
and[UINavigationItem rightBarButtonItems]
APIs? – Ell Neal