Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 7 UI changes : Status bar and Navigation controller

I want to update my app for iOS 7. I installed app from app store on iOS 7, it looked good, UI was perfect. But when i installed app from Xcode 5, It shows navigation bar and other views beneath status bar. I read the iOS 7 transition document which suggested to use auto layout. My app target is 5.1 and later, Auto layout supports only iOS 6 and later versions.

Please tell me, How can i fix it.

like image 224
user2163780 Avatar asked Feb 15 '23 07:02

user2163780


2 Answers

This is the only thing that actually worked for me: Add this to your view controller.

- (BOOL)prefersStatusBarHidden
{
    return YES;
}
like image 53
Bram Avatar answered Mar 03 '23 16:03

Bram


There's a complete answer to the status bar changes in this SO answer, but in short: no, there is no way to prevent the status bar from overlapping your application on iOS 7. You can "fake" it by moving all the view controllers of your app into an outer container view with a frame that is offset down from the top by 20 points.

like image 27
jaredsinclair Avatar answered Mar 03 '23 16:03

jaredsinclair