新的 iOS 7 statusBar 在 Xcode 5 编译的应用程序中留下了 20px 的范围 [英] New iOS 7 statusBar leaves a range 20px in apps compiled in Xcode 5

查看:20
本文介绍了新的 iOS 7 statusBar 在 Xcode 5 编译的应用程序中留下了 20px 的范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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!

解决方案

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.

这篇关于新的 iOS 7 statusBar 在 Xcode 5 编译的应用程序中留下了 20px 的范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆