问题描述
我已经在论坛上阅读了有关此属性的信息,大多数情况下是它的人将此属性设置为false或在情节提要中取消选中该属性.我自己做这件事是因为当我在视图中嵌入UINavigation Controller时,顶部栏将我的UITextView向下推,以便文本在底部开始编辑.
I have read on the forums about this property, mostly its people setting this this property to false or unchecking it in the storyboard.I have done this myself because when I have a UINavigation Controller embedded in a View, the top bar pushes my UITextView down so the text starts editing at the bottom.
取消选中UIViewController的StoryBoard顶部栏下方的扩展边缘可以解决我的问题,但我不知道发生了什么.
Unchecking Extended Edges Under Top Bars in the StoryBoard in the UIViewController solves my problem but I don't understand what is going on.
有人可以解释一下此属性的用途吗,我想了解更多有关此属性的信息.
Can someone give an explanation on what the purpose of this property is, I would like to know more about it.
推荐答案
默认情况下,iOS7中会自动插入UITableViewController的视图,这样它们就不会在导航栏/状态栏下方启动.这是由Interface Builder中UITableViewController的属性检查器"选项卡上的调整滚动视图插图"设置或UIViewController的 setAutomaticallyAdjustsScrollViewInsets:
方法来控制的.
By default, UITableViewController's views are automatically inset in iOS7 so that they don't start below the navigation bar/status bar. This is controller by the "Adjust scroll view insets" setting on the Attributes Inspector tab of the UITableViewController in Interface Builder, or by the setAutomaticallyAdjustsScrollViewInsets:
method of UIViewController.
对于UIViewController的内容,如果您不希望其视图的内容在顶部/底部栏下扩展,则可以使用Interface Builder中的顶部栏下/底部栏下的扩展边缘"设置.可通过 edgesForExtendedLayout
属性进行访问.
For a UIViewController's contents, if you don't want its view's contents to extend under the top/bottom bars, you can use the Extend Edges Under Top Bars/Under Bottom Bars settings in Interface Builder. This is accessible via the edgesForExtendedLayout
property.
参考: 为什么UIViewController在UINavigationBar下扩展而UITableViewController不扩展?
这篇关于UIViewController中的extension edge属性是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!