I have a app with main page is a hidden navigationbar ,and when I back from child page with navigationbar to this main page ,because I set the navigation hidden in the main page method: - (void)viewWillAppear, I found that a black box will appear with animation, how to avoid it? Thank you very much!!!
Ok , I find the answer:
self.navigationController.view.backgroundColor = [UIColor redColor];
This fixes the problem without hacking the colour, which could lead to navigation controllers being the wrong colour.
Just set it to be animated in viewWillAppear :)
-(void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:YES];
[self.navigationController setNavigationBarHidden:YES animated:YES];
}
and if you go back to page with nav controller set Animation to NO
- (IBAction)backButtonClicked:(id)sender {
[self.navigationController setNavigationBarHidden:NO animated:NO];
[self.navigationController popToRootViewControllerAnimated:YES];
}
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