iOS 7 Bugs – The Status Bar and Modal View Controllers

In iOS 7, the status bar and navigation bar are now unified. The status bar is translucent which is suppose to merge seamlessly with the navigation bar. This works great for the most part until you try to present a view controller or use a modal segue in storyboards.

[self presentViewController:myViewController animated:YES completion:nil];

Screen Shot 2013-09-20 at 4.12.57 PM

Using these options causes the status bar to overlay into the navigation bar.

To fix this you can add a top constraint of 20 pixels but then your left with a white status bar that doesn’t match your navigation bar.

A quick workaround to solve this is to add a view behind your status bar that’ll match your navigation bar.

UIView *fixItView = [[UIView alloc] init];
fixItView = CGRectMake(0, 0, 320, 20);
fixItView = [UIColor colorWithRed:0.973 green:0.973 blue:0.973 alpha:1]; //change this to match your navigation bar
[self.view addSubview:fixItView];

Of course this workaround is rather hackish and will only work with iOS 7. If you plan to support both iOS 6 and iOS 7, you can solve this problem by presenting a UINavigationController .

MyViewController *vc = [MyViewController new];
UINavigationController *nav = [[UINavigationController alloc] 
[self presentViewController:nav animated:YES completion:NULL];

The Result

Stay tuned for more iOS 7 bugs!


If ViewController use AutoLayout it hasn’t ‘Delta Y’, Isn’t it?
I’m using a UINavigationController and when I perform a modal segue from a VC inside of it and I come back, I have the same problem as you.
I’ve tested to embed the modal VC in a UINavigationController, as you say, but I have the same problem.
Are you using a UINavigationController at segue origin? And at segue destination?
How can I add a constraint to a UINavigationController’s UINavigationBar? Xcode doesn’t allow me to do it.

If your using AutoLayout, you should still be able to add a top constraint in IB. See the link above your comment. It worked for me.

I should be able to do it with a normal view but I can’t do it with the UINavigationBar of my UINavigationController.
Could you tell me exactly how you did it? I’m looking for a solution for days.. Thank you!

Leave a Reply

Your email address will not be published. Required fields are marked *

Please Do the Math      

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: