HarmonyOS bindContentCover或全局UI方法如何充满全屏

bindContentCover或全局UI方法,弹出组件或者dialog后底部有个安全区避让,如何充满不避让这个底部安全区?

HarmonyOS
2024-12-25 14:13:55
浏览
收藏 0
回答 1
待解决
回答 1
按赞同
/
按时间
aquaa

可使用沉浸式布局,参考示例如下:

// 在子窗口打开的页面 aboutToAppear 方法中设置沉浸式
aboutToAppear(): void {
  // 设置沉浸式
  window.getLastWindow(getContext(this), (err, windowBar) => {
  windowBar.setWindowLayoutFullScreen(true);
  // windowBar.setWindowSystemBarEnable([])
})
}

aboutToDisappear(): void {
  // 退出沉浸式
  window.getLastWindow(getContext(this), (err, windowBar) => {
  windowBar.setWindowLayoutFullScreen(false);
  // windowBar.setWindowSystemBarEnable([])
})
}

参考文档:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-window-V5#setwindowlayoutfullscreen9

分享
微博
QQ
微信
回复
2024-12-25 16:09:15
相关问题
HarmonyOS 全局UI样式复用
78浏览 • 1回复 待解决
如何获取UI组件的显示隐藏状态
2772浏览 • 1回复 待解决
HarmonyOS 背景图片如何充满组件
876浏览 • 1回复 待解决
HarmonyOS 获得全局监听触屏方法
171浏览 • 1回复 待解决
HarmonyOS 设置字体有全局方法吗?
605浏览 • 1回复 待解决
HarmonyOS 全局设置自定义字体的方法
220浏览 • 1回复 待解决
HarmonyOS @builder方法ui不刷新
417浏览 • 1回复 待解决
HarmonyOS 是否有种主动刷新UI方法
213浏览 • 1回复 待解决
在Native侧调用ArkTS的全局普通方法
1353浏览 • 1回复 待解决