How to prevent app from overlapping status bar in ios-11, iPhone-X, Xcode-9

假装没事ソ 提交于 2019-12-18 09:01:11

问题


I want to stop overlapping of my View with statusbar


回答1:


Use Auto Layout and pin your view to Top Layout Guide, or use the new Safe Area Layout Guides. To enable it, in your storyboard's File inspector tick the following option.

As an example I have used gray image view:

As you can see below, it does not overlap status bar:



来源:https://stackoverflow.com/questions/46275652/how-to-prevent-app-from-overlapping-status-bar-in-ios-11-iphone-x-xcode-9

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