diff --git a/zh-cn/application-dev/windowmanager/application-window-fa.md b/zh-cn/application-dev/windowmanager/application-window-fa.md index aa71125a54912afbbd39c8537376c31b893d5f07..8f5b869ad421b41df04785fb627fddbf7033c5cb 100644 --- a/zh-cn/application-dev/windowmanager/application-window-fa.md +++ b/zh-cn/application-dev/windowmanager/application-window-fa.md @@ -27,7 +27,7 @@ | window静态方法 | find(id: string, callback: AsyncCallback<Window>): void | 查找`id`所对应的窗口。 | | Window | loadContent(path: string, callback: AsyncCallback<void>): void | 为当前窗口加载具体页面内容。 | | Window | moveTo(x: number, y: number, callback: AsyncCallback<void>): void | 移动当前窗口。 | -| Window | setBackgroundColor(color: string, callback: AsyncCallback<void>): void | 设置窗口的背景色 | +| Window | setBackgroundColor(color: string, callback: AsyncCallback<void>): void | 设置窗口的背景色。 | | Window | setBrightness(brightness: number, callback: AsyncCallback<void>): void | 设置屏幕亮度值。 | | Window | resetSize(width: number, height: number, callback: AsyncCallback<void>): void | 改变当前窗口大小。 | | Window | setFullScreen(isFullScreen: boolean, callback: AsyncCallback<void>): void | 设置窗口是否全屏显示。 | @@ -136,16 +136,13 @@ 当不再需要某些子窗口时,可根据场景的具体实现逻辑,使用`destroy`接口销毁子窗口。 ```js - // 销毁子窗口。当不再需要某些子窗口时,可根据场景的具体实现逻辑,使用destroy接口销毁子窗口,此处以监听窗口区域外的点击事件实现子窗口的销毁。 - windowClass.on('touchOutside', () => { - console.info('touch outside'); - windowClass.destroy((err, data) => { - if (err.code) { - console.error('Failed to destroy the subwindow. Cause:' + JSON.stringify(err)); - return; - } - console.info('Succeeded in destroying the subwindow. Data: ' + JSON.stringify(data)); - }); + // 销毁子窗口。当不再需要某些子窗口时,可根据场景的具体实现逻辑,使用destroy接口销毁子窗口。 + windowClass.destroy((err, data) => { + if (err.code) { + console.error('Failed to destroy the subwindow. Cause:' + JSON.stringify(err)); + return; + } + console.info('Succeeded in destroying the subwindow. Data: ' + JSON.stringify(data)); }); ``` @@ -169,7 +166,7 @@ import window from '@ohos.window'; let mainWindowClass = null; - // 获取主窗口 + // 获取主窗口。 window.getTopWindow((err, data) => { if (err.code) { console.error('Failed to get the subWindow. Cause: ' + JSON.stringify(err)); @@ -216,12 +213,7 @@ console.info('Succeeded in setting the window layout to full-screen mode. Data: ' + JSON.stringify(data)); }); let sysBarProps = { - statusBarColor: '#ff00ff', - navigationBarColor: '#00ff00', - // 以下两个属性从API Version7开始支持 - isStatusBarLightIcon: false, - isNavigationBarLightIcon: false, - // 以下两个属性从API Version8开始支持 + // 以下两个属性从API Version8开始支持。 statusBarContentColor: '#ffffff', navigationBarContentColor: '#ffffff' };