iOS 7 - 状态栏与视图重叠 [英] iOS 7 - Status bar overlaps the view
问题描述
我有一个 ViewController
,它位于 UINavigationcontroller
中,但是navigationBar是隐藏的。当我在iOS 7上运行应用程序时,状态栏显示在我的视图之上。有没有办法避免这种情况?
I have a ViewController
which is inside a UINavigationcontroller
, but the navigationBar is hidden. When I run the app on iOS 7, the status bar shows on top of my view. Is there a way to avoid this?
我不想写任何特定于操作系统的代码。
I don't want to write any OS specific code.
我尝试设置查看基于控制器的状态栏外观
到否
,但它没有解决问题。
I tried setting View controller-based status bar appearance
to NO
, but it did not fix the issue.
推荐答案
Xcode 5 iOS 6/7 Deltas
专门用于解决此问题。在故事板中,我将我的视图向下移动了20个像素,以便在iOS 7上向右看,为了使iOS兼容,我将 Delta y
更改为-20。
Xcode 5 has iOS 6/7 Deltas
which is specifically made to resolve this issue. In the storyboard, I moved my views 20 pixels down to look right on iOS 7 and in order to make it iOS 6 compatible, I changed Delta y
to -20.
由于我的故事板没有使用自动布局,为了在iOS上正确调整视图的高度,我必须设置 Delta高度
以及 Delta Y
。
Since my storyboard is not using auto-layout, in order to resize the height of views properly on iOS 6 I had to set Delta height
as well as Delta Y
.
这篇关于iOS 7 - 状态栏与视图重叠的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!