const stateHeight=windowInformation.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM)

//获取屏幕底部高度
const bottomHeight=stateHeight.bottomRect.height
AppStorage.setOrCreate('bottomHeight',px2vp(bottomHeight))//存储状态栏高度给页面使用
Logo

讨论HarmonyOS开发技术,专注于API与组件、DevEco Studio、测试、元服务和应用上架分发等。

更多推荐