1. head标签的meta添加 viewport-fit=cover 详情如下;
<meta content="viewport-fit=cover" >
2.给最外部标签添加以下css样式:
body,html{
padding-top: constant(safe-area-inset-top);
padding-left: constant(safe-area-inset-left);
padding-right: constant(safe-area-inset-right);
padding-bottom: constant(safe-area-inset-bottom);
padding-top: env(safe-area-inset-top);
padding-left: env(safe-area-inset-left);
padding-right: env(safe-area-inset-right);
padding-bottom: env(safe-area-inset-bottom);
}
网友评论