HarmonyOS 手机底部小横条遮挡UI

HarmonyOS
2024-12-24 17:22:23
浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
superinsect

可以通过设置底部导航栏的高度来避免横杠挡住内容

// 获取应用主窗口
let windowClass: window.Window = windowStage.getMainWindowSync();
// 以导航条避让为例
let type = window.AvoidAreaType.TYPE_NAVIGATION_INDICATOR;
let avoidArea = windowClass.getWindowAvoidArea(type);
// 获取到导航条区域的高度 
let bottomRectHeight = avoidArea.bottomRect.height;
console.log(""bottomRectHeight: "" + bottomRectHeight)
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
分享
微博
QQ
微信
回复
2024-12-24 20:09:34
相关问题
HarmonyOS 底部横条和子window路由问题
554浏览 • 1回复 待解决
HarmonyOS tabContent底部遮挡
861浏览 • 1回复 待解决
HarmonyOS 底部遮挡的问题处理
708浏览 • 1回复 待解决
未适配底部导航条,会出现遮挡情况
2981浏览 • 1回复 待解决
HarmonyOS 获取手机底部导航栏高度
1083浏览 • 1回复 待解决
HarmonyOS 手机底部AI导航能否隐藏
830浏览 • 1回复 待解决
HarmonyOS 艺开放平台
842浏览 • 1回复 待解决
HarmonyOS tabbar 区域遮挡问题
518浏览 • 1回复 待解决
HarmonyOS 手机系统升级后ui变得卡顿
1037浏览 • 1回复 待解决
HarmonyOS 键盘收缩以后有遮挡
787浏览 • 1回复 待解决
HarmonyOS 键盘遮挡输入框
701浏览 • 1回复 待解决
HarmonyOS webview输入框被遮挡
764浏览 • 1回复 待解决
HarmonyOS Toast弹出的时候被键盘遮挡
1246浏览 • 1回复 待解决