openharmony 鸿蒙 capi-arkui-nativemodule-arkui-nativedialogapi-2

2026-08-25 浏览 (1)

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

NameDescription
ArkUI_NativeDialogAPI_1 nativeDialogAPI1Collection of native-side custom dialog box APIs provided by ArkUI, covering the scope of ArkUI_NativeDialogAPI_1.
Since: 15

Member Functions

NameDescription
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

NameDescription
ArkUI_NativeDialogHandle handlePointer to the custom dialog box controller.
float distanceDistance to avoid the keyboard, in vp by default.
ArkUI_LengthMetricUnit unitUnit of the avoidance distance. The parameter type is ArkUI_LengthMetricUnit.

Returns

TypeDescription
int32_tResult 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

NameDescription
ArkUI_NativeDialogHandle handlePointer to the custom dialog box controller.
ArkUI_LevelMode levelModeDisplay level to set, specified by an enumerated value of ArkUI_LevelMode.

Returns

TypeDescription
int32_tResult 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

NameDescription
ArkUI_NativeDialogHandle handlePointer to the custom dialog box controller.
int32_t uniqueIdID of the node under the dialog box's display level. The dialog box will be displayed on the same page as this node.

Returns

TypeDescription
int32_tResult 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

NameDescription
ArkUI_NativeDialogHandle handlePointer to the custom dialog box controller.
ArkUI_ImmersiveMode immersiveModeDisplay area, specified by an enumerated value of ArkUI_ImmersiveMode.

Returns

TypeDescription
int32_tResult 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

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/AUZDLn0g