提交 96ae18d7 编写于 作者: E ester.zhou

update ts-methods-custom-dialog-box.md

Signed-off-by: Nester.zhou <ester.zhou@huawei.com>
上级 b5db8417
# Custom Dialog Box # Custom Dialog Box
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** > **NOTE**<br>
> This method is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version. > This method is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
...@@ -20,8 +20,9 @@ CustomDialogController(value:{builder: CustomDialog, cancel?: () =&gt; void, au ...@@ -20,8 +20,9 @@ CustomDialogController(value:{builder: CustomDialog, cancel?: () =&gt; void, au
| cancel | () =&gt; void | No | - | Callback invoked when the dialog box is closed after the overlay exits. | | cancel | () =&gt; void | No | - | Callback invoked when the dialog box is closed after the overlay exits. |
| autoCancel | boolean | No | true | Whether to allow users to click the overlay to exit. | | autoCancel | boolean | No | true | Whether to allow users to click the overlay to exit. |
| alignment | DialogAlignment | No | DialogAlignment.Default | Alignment mode of the dialog box in the vertical direction. | | alignment | DialogAlignment | No | DialogAlignment.Default | Alignment mode of the dialog box in the vertical direction. |
| offset | {<br/>dx: Length \|[Resource](../../ui/ts-types.md#resource),<br/>dy: Length \|[Resource](../../ui/ts-types.md#resource)<br/>} | | | Offset of the dialog box relative to the alignment position. | | offset | {<br/>dx: Length \|[Resource](../../ui/ts-types.md#resource),<br/>dy: Length \|[Resource](../../ui/ts-types.md#resource)<br/>} | No | - | Offset of the dialog box relative to the alignment position. |
| customStyle | boolean | No | false | Whether the style of the dialog box is customized. | | customStyle | boolean | No | false | Whether the style of the dialog box is customized. |
| gridCount<sup>8+</sup> | number | No | - | Count of grid columns occupied by the dialog box. |
- DialogAlignment enums - DialogAlignment enums
| Name | Description | | Name | Description |
...@@ -38,7 +39,7 @@ CustomDialogController(value:{builder: CustomDialog, cancel?: () =&gt; void, au ...@@ -38,7 +39,7 @@ CustomDialogController(value:{builder: CustomDialog, cancel?: () =&gt; void, au
| BottomEnd<sup>8+</sup> | Bottom right alignment. | | BottomEnd<sup>8+</sup> | Bottom right alignment. |
### CustomDialogController ## CustomDialogController
### Objects to Import ### Objects to Import
...@@ -48,17 +49,14 @@ CustomDialogController(value:{builder: CustomDialog, cancel?: () =&gt; void, au ...@@ -48,17 +49,14 @@ CustomDialogController(value:{builder: CustomDialog, cancel?: () =&gt; void, au
dialogController : CustomDialogController = new CustomDialogController(value:{builder: CustomDialog, cancel?: () => void, autoCancel?: boolean}) dialogController : CustomDialogController = new CustomDialogController(value:{builder: CustomDialog, cancel?: () => void, autoCancel?: boolean})
``` ```
### open()
### dialogController.open
open(): void open(): void
Opens the content of the custom dialog box. If the content has been displayed, this API does not take effect. Opens the content of the custom dialog box. If the content has been displayed, this API does not take effect.
### dialogController.close ### close
close(): void close(): void
Closes the custom dialog box. If the dialog box is closed, the setting does not take effect. Closes the custom dialog box. If the dialog box is closed, the setting does not take effect.
...@@ -67,7 +65,8 @@ Closes the custom dialog box. If the dialog box is closed, the setting does not ...@@ -67,7 +65,8 @@ Closes the custom dialog box. If the dialog box is closed, the setting does not
## Example ## Example
``` ```ts
// xxx.ets
@CustomDialog @CustomDialog
struct CustomDialogExample { struct CustomDialogExample {
controller: CustomDialogController controller: CustomDialogController
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册