I'm seeing when I migrated my app to iOS 7, the nav bar is appearing under the status bar when presenting a view controller. I think a lot of people have run into this same issue. Here's a screenshot of what I'm seeing:
The new view must appear "modally", i.e. I need presentViewController.
Display some sort of nav bar or toolbar, with the status bar taking on the background color of the nav bar ala iOS 7 style.
It must work on iOS 6.
I'm using a xib to handle layout, with autolayout enabled.
Ugh, are we back to the pre-iOS 5 days and mucking with frames? Also it's generally not a good idea mixing with autolayout.
One disadvantage of options A and B is the status bar won't blend into your nav:
The main disadvantage is you'll have to muck with constraints and calculating the nav and status bar heights. Yuck.
Looks good on iOS 7, but breaks on iOS 6. You'll need to programatically update the height of the nav bar, and also make sure the rest of your view updates appropriately. Messy.
Multiple disadvantages: You'll be hardcoding the ios6/7 deltas. Also doesn't work with autolayout.
This is the workaround I selected. See answer below.
The easiest workaround I've found is to wrap the view controller you want to present inside a navigation controller, and then present that navigation controller.
MyViewController *vc = [MyViewController new]; UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc]; [self presentViewController:nav animated:YES completion:NULL];
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