如何防止app在ios-11,iPhone-X,Xcode-9中重叠状态栏 [英] How to prevent app from overlapping status bar in ios-11, iPhone-X, Xcode-9

查看:508
本文介绍了如何防止app在ios-11,iPhone-X,Xcode-9中重叠状态栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想停止将我的视图与状态栏重叠

I want to stop overlapping of my View with statusbar

推荐答案

使用自动布局并将视图固定到顶部布局指南,或使用新的安全区域布局指南。要启用它,请在故事板的文件检查器中勾选以下选项。

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:

这篇关于如何防止app在ios-11,iPhone-X,Xcode-9中重叠状态栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆