Search code examples
iosios6ios7storyboard

iOS7 - why do elements of the page shift when I view things as iOS 6 or 7


I am upgrading an app to comply with iOS7. But I am having some strange behavior.

As you can see from the screen shot below, when I view things as iOS 6.1, for some reason, the UIListView item gets pushed down when it is set to be right below the buttons in the storyboard.

image

But when I view things as iOS7 and run the app, it appears as it was intended..shown in this screenshot:

enter image description here

Would anyone know why this happens, and what is the correct way to handle this kind of a situation?

Thank you!


Solution

  • The status bar on iOS 7 doesn't take away the space. It overlays it the same way the navigation bar does. So you have an extra 20px to account for.

    Check for iOS 7 and handle the frame of your objects.

    You can check the iOS version with this

    if (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1)