What is safe area in xib in xcode 9? [duplicate]

巧了我就是萌 提交于 2019-12-29 04:35:31

问题


Can you please let me know what is safe area (highlighted in image) in xibs in xcode 9. and what is use of this?


回答1:


Example link of safe area XIB.

Safe label constraints is -

  • Safe Area Layout Guide is UIView property, Safe areas help you place your views within the visible portion of the overall interface.

  • Safe area not covers navigation bars, tab bars, toolbars, and other ancestor views.

  • Use safe areas as an aid to laying out your content.

  • When designing for iPhone X, you must ensure that layouts fill the screen and aren't obscured by the device's rounded corners, sensor housing, or the indicator for accessing the Home screen.

  • Make sure backgrounds extend to the edges of the display, and that vertically scrollable layouts, like tables and collections, continue all the way to the bottom.

Apple Doc Safe area layoutguide

iPhone X Design Guide




回答2:


Safe Area is a layout guide. The layout guide representing the portion of your view that is unobscured by bars and other content. In iOS 11, Apple is deprecating the top and bottom layout guides and replacing them with a single safe area layout guide.

Apple introduced the topLayoutGuide and bottomLayoutGuide as properties of UIViewController way back in iOS 7. They allowed you to create constraints to keep your content from being hidden by UIKit bars like the status, navigation or tab bar. These layout guides are deprecated in iOS 11 and replaced by a single safe area layout guide.



来源:https://stackoverflow.com/questions/46111811/what-is-safe-area-in-xib-in-xcode-9

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!