入口在 EntryAbility.ets #onWindowStageCreate()方法

windowStage.loadContent('pages/Index', (err) => {
      if (err.code) {
        hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? '');
        return;
      }
      hilog.info(0x0000, 'testTag', 'Succeeded in loading the content.');
    });
    // 设置应用全屏
    windowStage.getMainWindow().then((win) => {
      win.setWindowLayoutFullScreen(true);
});

官方文档地址:文档中心

Logo

讨论HarmonyOS开发技术,专注于API与组件、DevEco Studio、测试、元服务和应用上架分发等。

更多推荐