xcode 9中xib的安全区域是什么?

时间:2017-09-08 08:17:46

标签: ios xib xcode9 safearealayoutguide

你可以告诉我xcode 9中xibs中的安全区域(图中突出显示)是什么用途?

enter image description here

2 个答案:

答案 0 :(得分:6)

Example link of safe area XIB

Enable Safe Area layout guide

enter image description here

enter image description here

enter image description here enter image description here

安全标签限制是 -

enter image description here

  • Safe Area Layout GuideUIView属性,安全区域可帮助您将视图置于整个界面的可见部分。

  • 安全区域不包括导航栏,标签栏,工具栏和其他祖先视图。

  • 使用安全区域来帮助您布置内容。

  • 在设计iPhone X时,您必须确保布局填满屏幕,并且不会被设备的圆角,传感器外壳或用于访问主屏幕的指示器遮挡。< / p>

  • 确保背景延伸到显示器的边缘,并且垂直可滚动的布局(如表格和集合)一直延伸到底部。

Apple Doc Safe area layoutguide

iPhone X Design Guide

答案 1 :(得分:3)

安全区域是布局指南。 布局指南表示视图中不受条形和其他内容影响的部分。在iOS 11中,Apple不赞成使用顶部和底部布局指南,并使用单个安全区域布局指南替换它们。

Apple在iOS 7中引入了topLayoutGuide和bottomLayoutGuide作为UIViewController的属性。它们允许您创建约束,以防止UIKit栏(如状态,导航或标签栏)隐藏您的内容。这些布局指南在iOS 11中已弃用,并替换为单个安全区域布局指南。