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.
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:
- use a custom background image that is sized accordingly.. IIRC 44 (for navbar) + 20 (for status bar)
OR
- 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
select projectname-info.plist (Resources section in xcode)
and add key "View controller-based status bar appearance" and value "NO"
Related Topics
How to Programmatically Send Sms on the Iphone
Vertically Align Text to Top Within a Uilabel
Fatal Error: Unexpectedly Found Nil While Unwrapping an Optional Values
Objective-C Arc: Strong VS Retain and Weak VS Assign
Ios Uiimagepickercontroller Result Image Orientation After Upload
Getting the Difference Between Two Dates (Months/Days/Hours/Minutes/Seconds) in Swift
How to Export Uiimage Array as a Movie
How to Take a Screenshot Programmatically on Ios
Set the Maximum Character Length of a Uitextfield
Hide Strange Unwanted Xcode Logs
How to Return Value from Alamofire
Adjust Uilabel Height Depending on the Text
How to Force View Controller Orientation in iOS 8
Firebase Query - Find Item With Child That Contains String
Passing Data With Unwind Segue
How to Pass Textfield Value to View Controller Through Button Click in Swift Ui