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

update zh-cn/application-dev/windowmanager/application-window-fa.md.

Signed-off-by: N葛亚芳 <geyafang@huawei.com>
上级 e94a0a45
......@@ -27,7 +27,7 @@
| window静态方法 | find(id: string, callback: AsyncCallback&lt;Window&gt;): void | 查找`id`所对应的窗口。 |
| Window | loadContent(path: string, callback: AsyncCallback&lt;void&gt;): void | 为当前窗口加载具体页面内容。 |
| Window | moveTo(x: number, y: number, callback: AsyncCallback&lt;void&gt;): void | 移动当前窗口。 |
| Window | setBackgroundColor(color: string, callback: AsyncCallback&lt;void&gt;): void | 设置窗口的背景色 |
| Window | setBackgroundColor(color: string, callback: AsyncCallback&lt;void&gt;): void | 设置窗口的背景色 |
| Window | setBrightness(brightness: number, callback: AsyncCallback&lt;void&gt;): void | 设置屏幕亮度值。 |
| Window | resetSize(width: number, height: number, callback: AsyncCallback&lt;void&gt;): void | 改变当前窗口大小。 |
| Window | setFullScreen(isFullScreen: boolean, callback: AsyncCallback&lt;void&gt;): 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'
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册