New iOS 7 statusBar leaves a range 20px in apps compiled in Xcode 5

jucajl picture jucajl · Jun 14, 2013 · Viewed 33.5k times · Source

this week came out iOS 7 Beta , and whenever an update comes out these always have to update the apps for compatibility consetar some bugs.

Well, I installed iOS 7 on my iPhone and apps principle worked perfectly, then installed Xcode 5 (preview) and compiled my projects, I realized that the new statusBar now is totally calm, your view controller will appear as her background.

This is where the problem arises, a white band of 20px at the bottom of the screen, due to the view controller have won the space that was once the statusBar.

If I fix this problem in my storyboards is all right, but then the problem in iOS 6 because of the 20px statusBar there are still there and the screen will be cut off.

I thought the simple solution was to check the version of iOS on startup and create a storyboard according to each one. In my project I have 3 storyboards, iPhone 3.5', 'iPhone 4' and 'iPad'. Soon have to create 3 more storyboards so because these 20 px.

That would be the best solution? I have some other alternative?

Sorry for the long text. Any help is welcome!

Answer

Cliff Harris picture Cliff Harris · Jun 15, 2013

It's actually a fix for an old bug. The earlier versions of Xcode didn't handle the status bar correctly so people set the window's Y parameter to zero. The correct value would be 20, the vertical thickness of the status bar.

I vaguely recall that there is also a parameter in Interface Builder that would let you specify that the status bar was to be present, which would add 20 to the Y parameter. This didn't work correctly either.

Now that the bug has been fixed all the older windows will be 20 pixels higher than they should be (basically up under the status bar).

The consensus on the Apple dev forums is that Apple will add a way to specify iOS6 vs. iOS7 behavior in Interface Builder to fix this problem.