iPhone X Safe Area Appears to be below Opaque Toolbar

余生颓废 提交于 2019-12-07 01:27:34

问题


I can't properly constrain a view on the iPhone X to be above the bottom opaque toolbar.

You can see here that the view constrained to the bottom of the Safe area is obscured by the toolbar:

While for other iPhone models and sizes the view is correctly displayed above the toolbar:

Here are the constraints I've added:

Could someone kindly explain me what should I do?


回答1:


I've solved the issue by selecting "Extend edges under Opaque Bars" for the UIViewController in question:

With option enabled:

With option disabled:

The other option is to use a translucent toolbar as @Silmaril has mentioned in another answer to the question.




回答2:


This is definitely iOS bug.

Try use translucent toolbar because bug is not reproducible when toolbar is translucent.

Other option is to add toolbar directly on view controller




回答3:


use size to fit content ⌘ (+) =



来源:https://stackoverflow.com/questions/46701391/iphone-x-safe-area-appears-to-be-below-opaque-toolbar

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