..._safe-area">
赞
踩
safe-area-inset-*
样式不生效meta name="viewport"
中增加viewport-fit=cover
内容方法1: 修改html
<meta name="viewport" id="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, viewport-fit=cover">
方法2:js动态调整
(document.getElementsByName('viewport')[0] as HTMLMetaElement).content =
'user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, viewport-fit=cover';
iOS 11
constant(safe-area-inset-top)
iOS 11.2+env(safe-area-inset-top)
left: .6rem;
left: calc(env(safe-area-inset-left) + .6rem);
left: calc(constant(safe-area-inset-left) + .6rem);
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。