Ios 7 - Status Bar Overlaps the View

iOS 7 - Status bar overlaps the view

Xcode 5 has iOS 6/7 Deltas which is specifically made to resolve this issue. In the storyboard, I moved my views 20 pixels down to look right on iOS 7 and in order to make it iOS 6 compatible, I changed Delta y to -20.

Sample Image

Since my storyboard is not using auto-layout, in order to resize the height of views properly on iOS 6 I had to set Delta height as well as Delta Y.

iOS 7 status bar overlapping UI

You can resolve this issue if you are using storyboards, as in this question: iOS 7 - Status bar overlaps the view

If you're not using storyboard, then you can use this code in your AppDelegate.m in did finishlaunching:

if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) {
[application setStatusBarStyle:UIStatusBarStyleLightContent];
self.window.clipsToBounds =YES;
self.window.frame = CGRectMake(0,20,self.window.frame.size.width,self.window.frame.size.height-20);
}

Also see this question: Status bar and navigation bar issue in IOS7

how to fix status bar overlap issue in ios 7

 -(void)viewWillLayoutSubviews{

if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7)
{
self.view.clipsToBounds = YES;
CGRect screenRect = [[UIScreen mainScreen] bounds];
CGFloat screenHeight = 0.0;
if(UIDeviceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation]))
screenHeight = screenRect.size.height;
else
screenHeight = screenRect.size.width;
CGRect screenFrame = CGRectMake(0, 20, self.view.frame.size.width,screenHeight-20);
CGRect viewFr = [self.view convertRect:self.view.frame toView:nil];
if (!CGRectEqualToRect(screenFrame, viewFr))
{
self.view.frame = screenFrame;
self.view.bounds = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
}
}
}

iOS 7 status bar overlaps camera controls on UIImagePickerController

I think the answer to this question is "This is an iOS 7 bug". None of the methods here helped in our case, and several people have tried to fix this now.

I can't say what steps to reproduce this, but I've seen enough people out there with the same issue, that I think it's safe to say that this is in fact an iOS 7 bug. Most people can fix this problem with the multiple methods listed above. Rarely though, you can't fix it that way. I hope if you are reading this, you are not also one of those people.

Overlaps the status bar on view iOS7

wont happen, two options:

  1. use a custom background image that is sized accordingly.. IIRC 44 (for navbar) + 20 (for status bar)

OR

  1. account for the 20 pixels by using a custom view which is black :D

iOS 7 status bar overlapping UI - Need solution for Cordova 3.0

If you don't want to hide status bar check this solution

function onDeviceReady() {
if (parseFloat(window.device.version) === 7.0) {
document.body.style.marginTop = "20px";
}
}


document.addEventListener('deviceready', onDeviceReady, false);

OR
Hide the status bar

Open Project in xcode first select checkbox ( hide during application launch ) under status bar style - general project settings in xcode
Sample Image

select projectname-info.plist (Resources section in xcode) Sample Image

and add key "View controller-based status bar appearance" and value "NO" Sample Image



Related Topics



Leave a reply



Submit