iOS 7 - 状态栏与视图重叠 [英] iOS 7 - Status bar overlaps the view
问题描述
我有一个 ViewController
,它位于 UINavigationcontroller
内,但导航栏是隐藏的.当我在 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.
我尝试将基于视图控制器的状态栏外观
设置为NO
,但没有解决问题.
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 6 兼容,我将 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 6 上正确调整视图的高度,我必须设置 Delta height
以及 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屋!