Reputation: 481
I have some wierd bug with UINavigationBar.
Sometimes it just disappears (actually if you move view to the half of screen, and then just release it)
In the first ViewController's viewWillAppear:
method i call:
[self.navigationController setNavigationBarHidden:NO animated:YES];
The second ViewController's viewWillAppear:
contains:
[self.navigationController setNavigationBarHidden:YES animated:NO];
I tried change animated:
parameter, but it doesn't help.
Is it iOS7 bug or I just doing something wrong?
Upvotes: 3
Views: 1265
Reputation: 124
I got the same problem, and fixed it. the solution is:
Modify info.plist, set "View controller-based status bar appearance " to NO;
Delete all - (UIStatusBarStyle)preferredStatusBarStyle {} ;
If your view controller has different status bar style, use [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
e.g. in viewWillAppear set to light, in disappear ,set to dark style.
Upvotes: 1
Reputation: 481
I found the reason for this.
That's happened because in info.plist
View controller-based status bar appearance
is equal to YES
If change it to NO
, then all will be fine
Upvotes: 2
Reputation: 399
You should define appearance per navigation controller. If you want to have a navigation bar on the second controller only you should do the following in that particular controller:
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:NO animated:YES];
}
- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
[self.navigationController setNavigationBarHidden:YES animated:YES];
}
That way it will event work if you would need to change order of your controllers.
Upvotes: 0