关于 iphone H5刘海屏适配


默认刘海屏的webview是有安全区域的,加上viewport-fit=cover属性后webview会全屏,全屏后为了适配刘海屏加上安全区域

padding-top: 1rem;//android样式
padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);// ios 样式
padding: constant(safe-area-inset-top) constant(safe-area-inset-right) constant(safe-area-inset-bottom) constant(safe-area-inset-left); // ios样式

ios两个样式原因
when the iPhone X first came out, it used  constant() instead of  env(), but as of 11.2,  constant() has been removed in favor of the standardized  env()


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM