问题描述
本周推出了iOS 7 Beta,每当有更新发布时,这些都必须更新应用程序兼容性以避免一些错误。
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.
好吧,我安装了iOS 7我的iPhone和应用程序原理工作得很好,然后安装了Xcode 5(预览版)并编译了我的项目,我意识到新的statusBar现在完全平静,你的视图控制器将显示为她的背景。
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.
这就是出现问题的地方,屏幕底部有一个20px的白色条带,因为视图控制器赢得了曾经是statusBar的空间。
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.
如果我在故事板中解决了这个问题就可以了,但是由于20px statusBar,iOS 6中的问题仍然存在,屏幕将被切断。
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.
我认为简单的解决方案是在启动时检查iOS的版本并根据每个创建一个故事板。在我的项目中,我有3个故事板,iPhone 3.5','iPhone 4'和'iPad'。很快就要创建3个故事板,因为这20个px。
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!
推荐答案
这实际上是对旧bug的修复。早期版本的Xcode没有正确处理状态栏,因此人们将窗口的Y参数设置为零。正确的值将是20,状态栏的垂直厚度。
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.
我隐约回想起Interface Builder中还有一个参数可以让你指定状态bar将存在,这将为Y参数添加20。这也无法正常工作。
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.
现在错误已经修复,所有旧窗口都比它们应该高20个像素(基本上在状态栏下方) )。
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).
Apple开发论坛的共识是Apple将在Interface Builder中添加一种指定iOS6与iOS7行为的方法来解决这个问题。
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的范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!