未验证 提交 ffe4141f 编写于 作者: 葛亚芳 提交者: Gitee

update zh-cn/application-dev/reference/apis/js-apis-window.md.

Signed-off-by: N葛亚芳 <geyafang@huawei.com>
上级 f5ec6e39
......@@ -2466,28 +2466,28 @@ getUIContext(): UIContext
import UIAbility from '@ohos.app.ability.UIAbility';
export default class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage) {
// 为主窗口加载对应的目标页面。
windowStage.loadContent("pages/page2", (err) => {
if (err.code) {
console.error('Failed to load the content. Cause:' + JSON.stringify(err));
return;
}
console.info('Succeeded in loading the content.');
});
// 获取应用主窗口。
let windowClass = null;
windowStage.getMainWindow((err, data) => {
if (err.code) {
console.error('Failed to obtain the main window. Cause: ' + JSON.stringify(err));
return;
}
windowClass = data;
console.info('Succeeded in obtaining the main window. Data: ' + JSON.stringify(data));
// 获取UIContext实例。
globalThis.uiContext = windowClass.getUIContext();
})
}
onWindowStageCreate(windowStage) {
// 为主窗口加载对应的目标页面。
windowStage.loadContent("pages/page2", (err) => {
if (err.code) {
console.error('Failed to load the content. Cause:' + JSON.stringify(err));
return;
}
console.info('Succeeded in loading the content.');
// 获取应用主窗口。
let windowClass = null;
windowStage.getMainWindow((err, data) => {
if (err.code) {
console.error('Failed to obtain the main window. Cause: ' + JSON.stringify(err));
return;
}
windowClass = data;
console.info('Succeeded in obtaining the main window. Data: ' + JSON.stringify(data));
// 获取UIContext实例。
globalThis.uiContext = windowClass.getUIContext();
})
});
}
};
```
......@@ -5466,7 +5466,7 @@ setFullScreen(isFullScreen: boolean, callback: AsyncCallback&lt;void&gt;): void
> **说明:**
>
> 从 API version 6开始支持,从API version 9开始废弃,推荐使用[setWindowSystemBarEnable()](#setwindowsystembarenable9)
> 从 API version 6开始支持,从API version 9开始废弃,推荐联合使用[setWindowSystemBarEnable()](#setwindowsystembarenable9)和[setWindowLayoutFullScreen()](#setwindowlayoutfullscreen9)实现全屏
**系统能力:** SystemCapability.WindowManager.WindowManager.Core
......@@ -5500,7 +5500,7 @@ setFullScreen(isFullScreen: boolean): Promise&lt;void&gt;
> **说明:**
>
> 从 API version 6开始支持,从API version 9开始废弃,推荐使用[setWindowSystemBarEnable()](#setwindowsystembarenable9-1)
> 从 API version 6开始支持,从API version 9开始废弃,推荐联合使用[setWindowSystemBarEnable()](#setwindowsystembarenable9-1)和[setWindowLayoutFullScreen()](#setwindowlayoutfullscreen9-1)实现全屏
**系统能力:** SystemCapability.WindowManager.WindowManager.Core
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册