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

update en/application-dev/windowmanager/window-guidelines.md.

Signed-off-by: N@ge-yafang <geyafang@huawei.com>
上级 f6f916bc
...@@ -25,7 +25,7 @@ Currently, the main window is automatically created when the application is star ...@@ -25,7 +25,7 @@ Currently, the main window is automatically created when the application is star
### Creating a Subwindow ### Creating a Subwindow
You can call **create** to create a subwindow. The sample code is as follows: You can call **create** to create a subwindow. The sample code is as follows:
``` ```js
import window from '@ohos.window'; import window from '@ohos.window';
var windowClass = null; var windowClass = null;
let promise = window.create("subWindow", window.WindowType.TYPE_APP); let promise = window.create("subWindow", window.WindowType.TYPE_APP);
...@@ -41,7 +41,7 @@ You can call **create** to create a subwindow. The sample code is as follows: ...@@ -41,7 +41,7 @@ You can call **create** to create a subwindow. The sample code is as follows:
- Call **getTopWindow** to obtain the top window of the application. The sample code is as follows: - Call **getTopWindow** to obtain the top window of the application. The sample code is as follows:
``` ```js
var windowClass = null; var windowClass = null;
let promise = window.getTopWindow(); let promise = window.getTopWindow();
promise.then((data)=> { promise.then((data)=> {
...@@ -54,7 +54,7 @@ You can call **create** to create a subwindow. The sample code is as follows: ...@@ -54,7 +54,7 @@ You can call **create** to create a subwindow. The sample code is as follows:
- You can also call **find** to obtain created subwindows in the application. The sample code is as follows: - You can also call **find** to obtain created subwindows in the application. The sample code is as follows:
``` ```js
var windowClass = null; var windowClass = null;
let promise = window.find("subWindow"); let promise = window.find("subWindow");
promise.then((data)=> { promise.then((data)=> {
...@@ -69,7 +69,7 @@ You can call **create** to create a subwindow. The sample code is as follows: ...@@ -69,7 +69,7 @@ You can call **create** to create a subwindow. The sample code is as follows:
After a window object is obtained, you can call **hide** and **destroy** to hide and destroy the window object, respectively. The sample code is as follows: After a window object is obtained, you can call **hide** and **destroy** to hide and destroy the window object, respectively. The sample code is as follows:
``` ```js
let promise = windowClass.hide(); let promise = windowClass.hide();
promise.then((data)=> { promise.then((data)=> {
console.info('window hidden. Data: ' + JSON.stringify(data)) console.info('window hidden. Data: ' + JSON.stringify(data))
...@@ -91,7 +91,7 @@ After a window object is obtained, you can call **setFullScreen** to enable the ...@@ -91,7 +91,7 @@ After a window object is obtained, you can call **setFullScreen** to enable the
The sample code is as follows: The sample code is as follows:
``` ```js
import window from '@ohos.window'; import window from '@ohos.window';
try { try {
const win = await window.getTopWindow() const win = await window.getTopWindow()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册