I have a UIViewController
subclass which when I run the app on iOS 7, the status bar shows on top of my view. Is there a way to avoid this? I do not want the status bar to be hidden. Is there a way to show the status bar above my app. I present my view using presentViewController
. Please guide what I am missing?
Asked
Active
Viewed 677 times
0

Mayank Jain
- 5,663
- 7
- 32
- 65

puneetha koopadira
- 89
- 8
-
try this http://stackoverflow.com/questions/25781169/how-to-fix-status-bar-overlap-issue-in-ios-7/25884064#25884064 – Anbu.Karthik Nov 04 '14 at 09:24
-
possible duplicate of [Status bar and navigation bar appear over my view's bounds in iOS 7](http://stackoverflow.com/questions/17074365/status-bar-and-navigation-bar-appear-over-my-views-bounds-in-ios-7) – Mayank Jain Nov 04 '14 at 09:36
-
I used the below code to lower my view 20 px down..it worked fine for portrait orientation but fails for landscapeif ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) { if(self.view.frame.origin.y == 0) { CGRect viewBounds = [self.view bounds]; viewBounds.origin.y = 20; viewBounds.size.height = viewBounds.size.height - 20; self.view.frame = viewBounds; } } – puneetha koopadira Nov 04 '14 at 09:41
-
Try [this](http://stackoverflow.com/a/19522409/2835520) – IgniteCoders Nov 04 '14 at 10:02
-
possible duplicate of [iOS 7 status bar back to iOS 6 default style in iPhone app?](http://stackoverflow.com/questions/18294872/ios-7-status-bar-back-to-ios-6-default-style-in-iphone-app) – IgniteCoders Nov 04 '14 at 10:04
2 Answers
2
In Xcode, In storyboard there is an option of iOS6/7 delta. set delta Y to 20 pixel of your view, to make compatible with iOS7.For this you have to disable auto layout, you can use auto resizing.

Mayank Jain
- 5,663
- 7
- 32
- 65
0
This is quite common issue. Starting from iOS 7 Status Bar is a part of the controller's view. Apple even have added special attribute of UIView in the Interface Builder: iOS 6/7 Deltas. To fix your problem and make your view look the same in different iOS versions, go to Size inspector and set Delta Y to 20.0.

kelin
- 11,323
- 6
- 67
- 104
-
am not able to set deltas as I am using auto layout on my view – puneetha koopadira Nov 04 '14 at 09:38
-
In this case you should add a constraint and change its value programmatically according to iOS version. – kelin Nov 04 '14 at 14:00
-
can u tell me how to set status bar above my view programatically for iOS 7 for both portrait and landscape orientations using auto layout – puneetha koopadira Nov 05 '14 at 06:40