未验证 提交 7959e784 编写于 作者: O openharmony_ci 提交者: Gitee

!2831 Done! 2285:窗口管理-窗口开发指南问题修改

Merge pull request !2831 from wusongqing/TR2285
# Window Development
# When to Use
## When to Use
The interface layer of the window runs in the application process. It loads the page layout and provides APIs.
By calling these APIs, you can create and destroy a window, set the position and size of a window, and enter the immersive mode (full-screen mode).
......@@ -22,7 +22,7 @@ For details about the APIs, see [Window](https://gitee.com/openharmony/docs/blob
### Creating a Main Window
Currently, the main window is automatically created when the application is started. The declaration period, hiding, and destruction of the main window are managed by the application.
###Creating a Subwindow
### Creating a Subwindow
You can call **create** to create a subwindow. The sample code is as follows:
```
......@@ -87,22 +87,18 @@ After a window object is obtained, you can call **hide** and **destroy** to hide
### Enabling the Full-Screen Mode
After a window object is obtained,
- call **setFullScreen** to enable the full-screen mode for the window.
After a window object is obtained, you can call **setFullScreen** to enable the full-screen mode for the window.
The sample code is as follows:
```
import window from '@ohos.window';
.onClick(async () => {
try {
const win = await window.getTopWindow()
await win.setFullScreen(true)
} catch (err) {
console.log(`setFullScreen fail, code = ${err.code}`)
}
})
try {
const win = await window.getTopWindow()
await win.setFullScreen(true)
} catch (err) {
console.log(`setFullScreen fail, code = ${err.code}`)
}
```
For the complete code, see [immersive](https://gitee.com/openharmony/windowmanager/tree/master/AppDemo/window/immersive).
# Window Overview
The Window Manager subsystem provides basic capabilities of window and display management. It is the basis for UI display.
The Window Manager subsystem enables multiple applications to use the same physical screen for display and interaction. For each application, you only need to implement the interaction interface in the allocated display area. A window acts as a display container of the application interface, and the Window Manager subsystem organizes the interaction interfaces into a form visible to end users.
The Window Manager subsystem enables multiple applications to use the same physical screen for display and interaction. For each application, you need to design the interaction interface in the fixed window area. A window acts as a display container of the application interface, and the Window Manager subsystem organizes the interaction interfaces into a form visible to end users.
## Basic Concepts
**Immersive**
The colors of the application interface, status bar, and navigation bar are the same to achieve the visual integrity.
** Immersive**: The colors of the application interface, status bar, and navigation bar are the same to achieve the visual integrity.
## Working Principles
To display a UI on a screen, the application and system need to request a window object from the Window Manager subsystem. This object generally represents a rectangular area on the screen and has attributes such as the position, width, height, and overlay layer. The object also loads the root node of the UI framework in the interface. The UI of the application is loaded and displayed in the window through the root node.
## Constraints
Except the **on** and **off** APIs used for callback subscription and unsubscription, all other window APIs are asynchronous interfaces.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册