Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS status bar and UIView

There is UIView, status bar, iOS 7 and iOS 6. With iOS 6 everything is good: my UIView (transparent, under "Tap to set destination" label) appears right below status bar. Here is the picture:

enter image description here

The problem is with iOS 7. Here:

enter image description here

I expect that UIView will be under status bar, not beneath it. I have already tried to detect iOS version and if it's 7 or upper change UIView frame programmatically. But my UI with all the constraints made in storyboard... So it did not help. What can I do to resolve this problem?

UPD: maybe I really should make design more capable for iOS7? I'll think about it, and thanks for recommendations!

like image 648
Maria Avatar asked Dec 26 '13 14:12

Maria


1 Answers

In your View Controller viewDidLoad, you should add:

if (([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0)) {
    [self setEdgesForExtendedLayout:UIRectEdgeNone];
}
like image 159
LuisEspinoza Avatar answered Sep 19 '22 05:09

LuisEspinoza