iOS 7 status bar overlap the view. The text shows in the header of the screen. I want to show the screen with out the text in header called "Carrier, 4:49, and Battery"
How to handle this in iOS 6 and iOS 7 ?
iOS 7 status bar overlap the view. The text shows in the header of the screen. I want to show the screen with out the text in header called "Carrier, 4:49, and Battery"
How to handle this in iOS 6 and iOS 7 ?
You could hide it, I think that would look better in your case.
In your app plist add this
View controller-based status bar appearance, and set to NO
I think that it can help you:
if ([self respondsToSelector:@selector(edgesForExtendedLayout)]) {
self.edgesForExtendedLayout = UIRectEdgeNone;
}
Unfortunately you are not the only one with this problem, while on iOS before 7 the {0, 0} point was just below the status bar it is now at the top of the screen my advice is to add +20.0f to every y coordinate if in iOS 7
if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) {
// normal comportment
} else {
// add 20.0f offset
// you might also want to add a UIImageView subview to go behind the status bar (20pt of height, full width)
}
you might do it in view didLoad, for my part I calculate my elements position in static variables initialized in the +(void)initialize class method of my view controllers
if in -(void)viewDidLoad something like
if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) {
// normal comportment
} else {
for (UIView *v in self.view.subviews) {
CGRect oldFrame = v.frame;
v.frame = CGRectMake(oldFrame.origin.x, oldFrame.origin.y + 20.0f, oldFrame.size.width, oldFrame.size.height);
}
// you might also want to add a UIImageView subview to go behind the status bar (20pt of height, full width)
}
Its not a iOS 7 problem. Because status bar is transparent in iOS7. So you need to handle it manually.So please use right image here.
This may help you How to fix iOS 7 Status bar overlapping issue and status bar style
which worked for me.