ArkUI_NativeDialogAPI_2
typedef struct {...} ArkUI_NativeDialogAPI_2
Overview
Provides a collection of native-side custom dialog box APIs provided by ArkUI.
Since: 15
Related module: ArkUI_NativeModule
Header file: native_dialog.h
Summary
Member Variables
| Name | Description |
|---|---|
| ArkUI_NativeDialogAPI_1 nativeDialogAPI1 | Collection of native-side custom dialog box APIs provided by ArkUI, covering the scope of ArkUI_NativeDialogAPI_1. Since: 15 |
Member Functions
| Name | Description |
|---|---|
| int32_t (*setKeyboardAvoidDistance)(ArkUI_NativeDialogHandle handle, float distance, ArkUI_LengthMetricUnit unit) | Distance between the dialog box and the keyboard after keyboard avoidance is applied. |
| int32_t (*setLevelMode)(ArkUI_NativeDialogHandle handle, ArkUI_LevelMode levelMode) | Sets the display level of a dialog box. |
| int32_t (*setLevelUniqueId)(ArkUI_NativeDialogHandle handle, int32_t uniqueId) | Sets the ID of the node under the dialog box's display level. |
| int32_t (*setImmersiveMode)(ArkUI_NativeDialogHandle handle, ArkUI_ImmersiveMode immersiveMode) | Sets the display area of the embedded dialog box overlay. |
Member Function Description
setKeyboardAvoidDistance()
int32_t (*setKeyboardAvoidDistance)(ArkUI_NativeDialogHandle handle, float distance, ArkUI_LengthMetricUnit unit)
Description
Distance between the dialog box and the keyboard after keyboard avoidance is applied.
NOTE
This API must be called before the show API is invoked.
Since: 15
Parameters
| Name | Description |
|---|---|
| ArkUI_NativeDialogHandle handle | Pointer to the custom dialog box controller. |
| float distance | Distance to avoid the keyboard, in vp by default. |
| ArkUI_LengthMetricUnit unit | Unit of the avoidance distance. The parameter type is ArkUI_LengthMetricUnit. |
Returns
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if API initialization failed. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
setLevelMode()
int32_t (*setLevelMode)(ArkUI_NativeDialogHandle handle, ArkUI_LevelMode levelMode)
Description
Sets the display level of a dialog box.
NOTE
This API must be called before the show API is invoked.
Since: 15
Parameters
| Name | Description |
|---|---|
| ArkUI_NativeDialogHandle handle | Pointer to the custom dialog box controller. |
| ArkUI_LevelMode levelMode | Display level to set, specified by an enumerated value of ArkUI_LevelMode. |
Returns
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
setLevelUniqueId()
int32_t (*setLevelUniqueId)(ArkUI_NativeDialogHandle handle, int32_t uniqueId)
Description
Sets the ID of the node under the dialog box's display level.
NOTE
This API must be called before the setLevelMode API is invoked.
Since: 15
Parameters
| Name | Description |
|---|---|
| ArkUI_NativeDialogHandle handle | Pointer to the custom dialog box controller. |
| int32_t uniqueId | ID of the node under the dialog box's display level. The dialog box will be displayed on the same page as this node. |
Returns
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
setImmersiveMode()
int32_t (*setImmersiveMode)(ArkUI_NativeDialogHandle handle, ArkUI_ImmersiveMode immersiveMode)
Description
Sets the display area of the embedded dialog box overlay.
NOTE
This API must be called before the show API is invoked.
Since: 15
Parameters
| Name | Description |
|---|---|
| ArkUI_NativeDialogHandle handle | Pointer to the custom dialog box controller. |
| ArkUI_ImmersiveMode immersiveMode | Display area, specified by an enumerated value of ArkUI_ImmersiveMode. |
Returns
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
你可能感兴趣的鸿蒙文章
openharmony 鸿蒙 arkts-apis-uicontext-contextmenucontroller
openharmony 鸿蒙 errorcode-canvas
openharmony 鸿蒙 capi-oh-nativexcomponent-native-xcomponent-oh-nativexcomponent
openharmony 鸿蒙 errorcode-bindSheet
openharmony 鸿蒙 js-apis-arkui-uiExtension-sys
openharmony 鸿蒙 capi-arkui-accessibility-arkui-accessibilityeventinfo
openharmony 鸿蒙 capi-arkui-rendernodeutils
openharmony 鸿蒙 js-apis-arkui-node
openharmony 鸿蒙 capi-native-node-h
openharmony 鸿蒙 capi-arkui-nativemodule-arkui-listitemswipeactionitem