I have view controller transition like vc1 -> vc2 -> vc1. And I need the UINavigationBar be hidden in vc1, and showing in vc2.
I do the following:
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
self.navigationController.navigationBarHidden = YES;
}
- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
self.navigationController.navigationBarHidden = NO;
}
In iOS6, it works fine. But in iOS7, when I back to vc2 from vc1, the navigation bar is not hidden but moved upward behind the status bar, the bar got hidden after the transition animation finished.
How can I really hide the nav bar?