Question

I am developing in Xcode 5, and issue happens only in iOS versions below iOS 7. I have to keep status bar visible. I am using

self.wantsFullScreenLayout= YES;

But my view is still appearing beneath the status bar.

enter image description here

How can i fix this so the view is not covered by the status bar?

Was it helpful?

Solution

You need to set Delta of your UIViewController 's view.

Switch Story board to ios6.1 or later from utility area (1st item).

Then select view of your UIViewController and in size inspector menu in utility area there will be delta section below frame. There will be triangle before every delta. Change Triangle y to 64 (you should be on "ios6.1 or later" of your storyboard).

This means when storyboard is opened in ios7 then your UIViewController's view will start from 64 automatically . 64 is UINavigationbar height + UIStatusbar height.

If your UIViewController dont have UINavigationBar then Delta y = 20,(you should be on "ios6.1 or later" of your storyboard).

Once you change delta's in one ios it will automatically change its opposite.

If you need help on Deltas visit : Interface Builder: What are the UIView's Layout iOS 6/7 Deltas for?

OTHER TIPS

What iOS version are you targeting?

Do you want your view under the status bar or the status bar removed completely? If you want to get rid of the status bar

[[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO]; 

Are you targeting iOS 7? if so you can use this to hide the status bar

- (BOOL)prefersStatusBarHidden
{
    return YES;
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top