0

I'm struggling with this issue for hours. I know there are other similar questions here already.

Like: iOS 7 status bar overlapping UI

What I want to do is to adjust them in storyboard, to make them looking well for both iOS 6 and iOS 7. Their answers suggest that we can add 20 to the y of the view. Does it mean to add 20 to every view? Or just add it to the main view under each UIViewController? I think it would be fine to just modify the main view, but I find that it is not editable. If I modify each view's y coordinate value, it would be boring.

Anyone knows the quick fix solutions, please tell me. Thank you very much.

Community
  • 1
  • 1
Vigor
  • 1,706
  • 3
  • 26
  • 47

2 Answers2

1

In iOS7, some views can hide the status bar or have it transparent. So if you put a UI component at (0.0, 0.0) on iOS6 it will appear below the status bar, but on iOS7 it would appear underneath the status bar. So in that case you would want a delta that matches the status bar height which is 20.0 points.

You have to set -20 to ΔY for every UI component that start at (0,0) but you should also consider switching to auto layout if you do not have any specific reason (like maintaining support for iOS 5).

On the first tab in IB (the one with the Page icon) there is an option to see how your xib will look in iOS 6.

enter image description here

Nikos M.
  • 13,685
  • 4
  • 47
  • 61
0

Read this.

- (UIBarPosition)positionForBar:(id<UIBarPositioning>)bar {
    return UIBarPositionTopAttached;
}
user1502383
  • 323
  • 1
  • 5