默认刘海屏的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()

相关文章:

  • 2022-12-23
  • 2021-10-11
  • 2021-05-07
  • 2021-06-18
  • 2021-12-20
  • 2021-11-27
猜你喜欢
  • 2021-12-25
  • 2021-04-22
  • 2021-10-17
  • 2022-01-01
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案