UIViewController中的extension edge属性是什么?

编程入门 行业动态 更新时间:2024-10-18 01:38:58
本文介绍了UIViewController中的extension edge属性是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经在论坛上阅读了有关此属性的信息,大多数情况下是它的人将此属性设置为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属性是什么?

本文发布于:2023-11-02 14:11:42,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1552621.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:属性   UIViewController   extension   edge

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!