let type = window.AvoidAreaType.TYPE_NAVIGATION_INDICATOR; // 以导航条避让为例
let avoidArea = windowClass.getWindowAvoidArea(type);
// 此处获取的单位为px,需转为vp
let bottomRectHeight = px2vp(avoidArea.bottomRect.height); // 获取到导航条区域的高度
console.log("bottomRectHeight is " + bottomRectHeight);
1、获取布局避让遮挡的区域
2、还可以采用采用组件安全区方案,即不设置窗口全屏,这种场景下,针对底部的页签部分,Navigation组件和Tabs组件默认实现了页签的延伸处理,需要保证Navigation和Tabs组件的底部边界和底部导航条重合即可,参考:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/arkts-develop-apply-immersive-effects-V5\#section15107174585619
文档链接如下:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-window-V5