1

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 ? enter image description here

Hiren Patel
  • 69
  • 2
  • 9

5 Answers5

1

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

DogCoffee
  • 19,820
  • 10
  • 87
  • 120
1

I think that it can help you:

 if ([self respondsToSelector:@selector(edgesForExtendedLayout)]) {
    self.edgesForExtendedLayout = UIRectEdgeNone;
}
Joan Cardona
  • 3,463
  • 2
  • 25
  • 43
0

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)
}
Jerome Diaz
  • 1,746
  • 8
  • 15
0

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.

Dharmbir Singh
  • 17,485
  • 5
  • 50
  • 66
0

This may help you How to fix iOS 7 Status bar overlapping issue and status bar style

which worked for me.

Smith
  • 379
  • 6
  • 18