HarmonyOS鸿蒙Next中如何获取安全区域高度

HarmonyOS鸿蒙Next中window模块可以获取状态栏高度和安全区域高度

  //获取底部安全区域高度
  getSystemBarBottomHeight() {
    window.getLastWindow(getContext(this)).then((mainWindow) => {
      let avoidArea = mainWindow.getWindowAvoidArea(window.AvoidAreaType.TYPE_NAVIGATION_INDICATOR)
      this.bottomRectHeight = avoidArea.bottomRect.height
    })
  }

更多关于 HarmonyOS鸿蒙Next中如何获取安全区域高度的实战教程也可以访问 https://www.itying.com/category-93-b0.html

回到顶部