I am using a UINavigationController (side note: inside a UITabBar) which by default gives you a UINavigationBar on the top. If I hide the bar through IB, the bar is gone not only for the root UIViewController but also for all the controllers I push onto the stack. Leaving me no (automatic) way to pop back.
So how can hide the UINavigtionBar only on the root UIViewController. Switching on/off "navigationBarHidden" temporarily does not work as this looks awkward with the animation.
Any other ideas?
For me the easiest way to avoid the white space after hided the UInavigationBar is to hide or show your UInaviagtionBar as follow.
-(void)viewWillDisappear:(BOOL)animated
{
[super viewDidDisappear:animated];
[self.navigationController setNavigationBarHidden:NO animated:YES];
}
-(void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:YES animated:YES];
}
with the syntax : self.navigationController.navigationBarHidden = YES;
i always have the white space.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With