The layout guide representing the portion of your view that is unobscured by bars and other content.
SDKs
iOS 11.0+Beta
tvOS 11.0+Beta
Framework
UIKit
On This Page
Declaration
var safeAreaLayoutGuide:UILayoutGuide { get }
Discussion
When the view is visible onscreen, this guide reflects the portion of the view that is not covered by navigation bars, tab bars, toolbars, and other ancestor views. (In tvOS, the safe area reflects the area not covered the screen's bezel.) If the view is not currently installed in a view hierarchy, or is not yet visible onscreen, the layout guide edges are equal to the edges of the view.
For the view controller's root view, the layout guide accommodates the status bar, other visible bars, and any additional insets that you specified using the
property of your view controller. For other views in the view hierarchy, the layout guide reflects only the portion of the view that is covered by other content. For example, if a view is entirely within the safe area of its superview, the layout guide edges are equal to the edges of the view.
安全区域页面布局指示器
安全页面布局向导代表你设计的没有被bars和其他部分挡住的一部分页面
SDKs
iOS 11.0+Beta
tvOS 11.0+Beta
Framework
UIKit
声明
var safeAreaLayoutGuide: UILayoutGuide{ get }
介绍
当视图在页面可见,安全页面表示没有被导航栏和顶部tab bars,工具栏或者其他的继承页面(在tvOS,安全区域是区域没有被外圈挡住的界面)如果页面当前没有被安装在页面层,活着没有可见的界面,页面边缘和整个页面的边缘一样。
对于页面控制器主页面,页面布局适应状态栏,其他可见bars,以及其他的内建使用
属性。对于其他在view的层级view,页面指示器仅表示一部分被其他部分包含的view。比如,如果一个view的父视图完全是安全区域,那么视图指示器就和view的边缘一致。













网友评论