1 个回答

针对您提出的问题,可以在EntryAbility.ets文件中的onWindowStageCreate()方法中添加如下代码实现窗口全屏:

let windowClass: window.Window = windowStage.getMainWindowSync(); // 获取应用主窗口
let isLayoutFullScreen = true;
windowClass.setWindowLayoutFullScreen(isLayoutFullScreen)
  .then(() => {
    console.info('Succeeded in setting the window layout to full-screen mode.');
  })
  .catch((err: BusinessError) => {
    console.error('Failed to set the window layout to full-screen mode. Cause:' + JSON.stringify(err));
  });

开发应用沉浸式效果可以参考文档:

https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/arkts-develop-apply-immersive-effects-V5