xcode iOS 7 - 调整状态栏
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18939071/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
iOS 7 - adjusting for status bar
提问by user1032657
I am having trouble determining how to adjust for the status bar in iOS7. My view controller has a tableView
, and I want the tableView
to start under the status bar. Currently, it is being overlapped by the status bar. (The label at the top is a headerView
in the tableView
).
我无法确定如何调整 iOS7 中的状态栏。我的视图控制器有一个tableView
,我希望tableView
从状态栏下开始。目前,它被状态栏重叠。(在顶部的标签是headerView
在tableView
)。
I have set the properties on my view controller via IB as follows:
我已经通过 IB 在我的视图控制器上设置了属性,如下所示:
automaticallyAdjustsScrollViewInsets = YES
edgesForExtendedLayout = UIRectEdgeNone
Is the expected behavior for these settings for the status bar to overlap the tableView? Or am I missing something? I have tried enabling auto-layout, and changing the project settings to only support iOS 7.
这些状态栏设置的预期行为是否与 tableView 重叠?或者我错过了什么?我尝试启用自动布局,并将项目设置更改为仅支持 iOS 7。
采纳答案by user1032657
The solution is to check "Under Top Bars" and "Under Opaque Bars" in the Extend Edges section of IB.
解决方法是在IB的Extend Edges部分勾选“Under Top Bars”和“Under Opaque Bars”。