HarmonyOS 应用横屏后底部会多出一条系统按钮要如何去掉

应用横屏后底部会多出一条系统按钮,要如何去掉?

HarmonyOS 应用横屏后底部会多出一条系统按钮要如何去掉 -鸿蒙开发者社区

HarmonyOS
2024-12-25 13:21:15
720浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
Heiang

可以在EntryAbility的onWindowStageCreate事件中设置以下方案:

let windowClass: window.Window | undefined = undefined;
windowStage.getMainWindow((err: BusinessError, data) => {
  const errCode: number = err.code;
  if (errCode) {
    console.error(`Failed to obtain the main window. Cause code: ${err.code}, message: ${err.message}`);
    return;
  }
  windowClass = data;
  let isLayoutFullScreen = true;
  try {

    windowClass.setWindowLayoutFullScreen(true)
    // 隐藏状态栏显示
    windowClass.setWindowSystemBarEnable(['navigation'])

  } catch (exception) {
    console.error(`Failed to set the window layout to full-screen mode. Cause code: ${exception.code}, message: ${exception.message}`);
  }
})
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
分享
微博
QQ
微信
回复
2024-12-25 15:08:17


相关问题
HarmonyOS 如何绘制一条虚线
857浏览 • 1回复 待解决
HarmonyOS 子窗口如何设置成
777浏览 • 1回复 待解决
HarmonyOS GridItem之间有一条竖线
650浏览 • 1回复 待解决
HarmonyOS 布局问题
1340浏览 • 1回复 待解决
Web如何实现全屏
271浏览 • 0回复 待解决
HarmonyOS Canvas定位问题
628浏览 • 1回复 待解决
HarmonyOS 底部系统导航怎么适配?
920浏览 • 1回复 待解决
应用如何适配华为悬浮窗?
3542浏览 • 1回复 待解决