• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# ArkUI_NativeDialogAPI_3
2<!--Kit: ArkUI-->
3<!--Subsystem: ArkUI-->
4<!--Owner: @houguobiao-->
5<!--Designer: @liyi0309-->
6<!--Tester: @lxl007-->
7<!--Adviser: @HelloCrease-->
8
9## 概述
10
11ArkUI提供的Native侧自定义弹窗接口集合。
12
13**起始版本:** 19
14
15**相关模块:** [ArkUI_NativeModule](capi-arkui-nativemodule.md)
16
17**所在头文件:** [native_dialog.h](capi-native-dialog-h.md)
18
19## 汇总
20
21### 成员变量
22
23| 名称                                                                                             | 描述 |
24|------------------------------------------------------------------------------------------------| -- |
25| [ArkUI_NativeDialogAPI_1](capi-arkui-nativemodule-arkui-nativedialogapi-1.md) nativeDialogAPI1 | ArkUI提供的Native侧自定义弹窗接口集合,范围是[ArkUI_NativeDialogAPI_1](capi-arkui-nativemodule-arkui-nativedialogapi-1.md)。<br>**起始版本:** 19 |
26| [ArkUI_NativeDialogAPI_2](capi-arkui-nativemodule-arkui-nativedialogapi-2.md) nativeDialogAPI2                                                   | ArkUI提供的Native侧自定义弹窗接口集合,范围是[ArkUI_NativeDialogAPI_2](capi-arkui-nativemodule-arkui-nativedialogapi-2.md)。<br>**起始版本:** 19 |
27
28
29### 成员函数
30
31| 名称 | 描述 |
32| -- | -- |
33| [int32_t (\*setLevelOrder)(ArkUI_NativeDialogHandle handle, double levelOrder)](#setlevelorder) | 设置自定义弹窗显示的顺序。 |
34| [int32_t (\*registerOnWillAppear)(ArkUI_NativeDialogHandle handle, void* userData, void (\*callback)(void* userData))](#registeronwillappear) | 注册自定义弹窗显示之前的回调函数。 |
35| [int32_t (\*registerOnDidAppear)(ArkUI_NativeDialogHandle handle, void* userData, void (\*callback)(void* userData))](#registerondidappear) | 注册自定义弹窗显示之后的回调函数。 |
36| [int32_t (\*registerOnWillDisappear)(ArkUI_NativeDialogHandle handle, void* userData, void (\*callback)(void* userData))](#registeronwilldisappear) | 注册自定义弹窗关闭之前的回调函数。 |
37| [int32_t (\*registerOnDidDisappear)(ArkUI_NativeDialogHandle handle, void* userData, void (\*callback)(void* userData))](#registerondiddisappear) | 注册自定义弹窗关闭之后的回调函数。 |
38| [int32_t (\*setBorderWidth)(ArkUI_NativeDialogHandle handle, float top, float right, float bottom, float left, ArkUI_LengthMetricUnit unit)](#setborderwidth) | 设置自定义弹窗的边框宽度。 |
39| [int32_t (\*setBorderColor)(ArkUI_NativeDialogHandle handle, uint32_t top, uint32_t right, uint32_t bottom, uint32_t left)](#setbordercolor) | 设置自定义弹窗的边框颜色。 |
40| [int32_t (\*setBorderStyle)(ArkUI_NativeDialogHandle handle, int32_t top, int32_t right, int32_t bottom, int32_t left)](#setborderstyle) | 设置自定义弹窗的边框样式。 |
41| [int32_t (\*setWidth)(ArkUI_NativeDialogHandle handle, float width, ArkUI_LengthMetricUnit unit)](#setwidth) | 设置自定义弹窗的背板宽度。 |
42| [int32_t (\*setHeight)(ArkUI_NativeDialogHandle handle, float height, ArkUI_LengthMetricUnit unit)](#setheight) | 设置自定义弹窗的背板高度。 |
43| [int32_t (\*setShadow)(ArkUI_NativeDialogHandle handle, ArkUI_ShadowStyle shadow)](#setshadow) | 设置自定义弹窗的背板阴影。 |
44| [int32_t (\*setCustomShadow)(ArkUI_NativeDialogHandle handle, const ArkUI_AttributeItem* customShadow)](#setcustomshadow) | 设置自定义弹窗的背板阴影。 |
45| [int32_t (\*setBackgroundBlurStyle)(ArkUI_NativeDialogHandle handle, ArkUI_BlurStyle blurStyle)](#setbackgroundblurstyle) | 设置自定义弹窗的背板模糊材质。 |
46| [int32_t (\*setKeyboardAvoidMode)(ArkUI_NativeDialogHandle handle, ArkUI_KeyboardAvoidMode keyboardAvoidMode)](#setkeyboardavoidmode) | 设置自定义弹窗避让键盘模式。 |
47| [int32_t (\*enableHoverMode)(ArkUI_NativeDialogHandle handle, bool enableHoverMode)](#enablehovermode) | 设置自定义弹窗是否响应悬停态。 |
48| [int32_t (\*setHoverModeArea)(ArkUI_NativeDialogHandle handle, ArkUI_HoverModeAreaType hoverModeAreaType)](#sethovermodearea) | 设置悬停态下自定义弹窗默认展示区域。 |
49| [int32_t (\*setFocusable)(ArkUI_NativeDialogHandle handle, bool focusable)](#setfocusable) | 设置自定义弹窗是否获取焦点。 |
50| [int32_t (\*setBackgroundBlurStyleOptions)(ArkUI_NativeDialogHandle handle, const ArkUI_AttributeItem* backgroundBlurStyleOptions)](#setbackgroundblurstyleoptions) | 设置自定义弹窗的背景模糊效果。 |
51| [int32_t (\*setBackgroundEffect)(ArkUI_NativeDialogHandle handle, const ArkUI_AttributeItem* backgroundEffect)](#setbackgroundeffect) | 设置自定义弹窗的背景效果参数。 |
52
53## 成员函数说明
54
55### setLevelOrder()
56
57```
58int32_t (*setLevelOrder)(ArkUI_NativeDialogHandle handle, double levelOrder)
59```
60
61**描述:**
62
63
64设置自定义弹窗显示的顺序。
65
66> **说明:**
67>
68> setLevelOrder方法需要在调用[show](capi-arkui-nativemodule-arkui-nativedialogapi-1.md#show)之前调用。
69
70**起始版本:** 19
71
72**参数:**
73
74| 参数项                                 | 描述 |
75|-------------------------------------| -- |
76| [ArkUI_NativeDialogHandle](capi-arkui-nativemodule-arkui-nativedialog8h.md) handle | 指向自定义弹窗控制器的指针。 |
77| double levelOrder                   | 自定义弹窗显示的顺序。默认值:0,取值范围:[-100000.0, 100000.0]。 |
78
79**返回:**
80
81| 类型 | 说明 |
82| -- | -- |
83| int32_t | 错误码。<br>             [ARKUI_ERROR_CODE_NO_ERROR](capi-native-type-h.md#arkui_errorcode) 成功。<br>             [ARKUI_ERROR_CODE_PARAM_INVALID](capi-native-type-h.md#arkui_errorcode) 函数参数异常。 |
84
85### registerOnWillAppear()
86
87```
88int32_t (*registerOnWillAppear)(ArkUI_NativeDialogHandle handle, void* userData, void (*callback)(void* userData))
89```
90
91**描述:**
92
93
94注册自定义弹窗显示之前的回调函数。
95
96> **说明:**
97>
98> registerOnWillAppear方法需要在调用[show](capi-arkui-nativemodule-arkui-nativedialogapi-1.md#show)之前调用。
99
100**起始版本:** 19
101
102**参数:**
103
104| 参数项                                 | 描述 |
105|-------------------------------------| -- |
106| [ArkUI_NativeDialogHandle](capi-arkui-nativemodule-arkui-nativedialog8h.md) handle | 指向自定义弹窗控制器的指针。 |
107| void* userData                      | 用户自定义数据。 |
108| callback                            | 自定义弹窗显示之前的回调函数。 |
109
110**返回:**
111
112| 类型 | 说明 |
113| -- | -- |
114| int32_t | 错误码。<br>             [ARKUI_ERROR_CODE_NO_ERROR](capi-native-type-h.md#arkui_errorcode) 成功。<br>             [ARKUI_ERROR_CODE_PARAM_INVALID](capi-native-type-h.md#arkui_errorcode) 函数参数异常。 |
115
116### registerOnDidAppear()
117
118```
119int32_t (*registerOnDidAppear)(ArkUI_NativeDialogHandle handle, void* userData, void (*callback)(void* userData))
120```
121
122**描述:**
123
124
125注册自定义弹窗显示之后的回调函数。
126
127> **说明:**
128>
129> registerOnDidAppear方法需要在调用[show](capi-arkui-nativemodule-arkui-nativedialogapi-1.md#show)之前调用。
130
131**起始版本:** 19
132
133**参数:**
134
135| 参数项 | 描述 |
136| -- | -- |
137| [ArkUI_NativeDialogHandle](capi-arkui-nativemodule-arkui-nativedialog8h.md) handle | 指向自定义弹窗控制器的指针。 |
138| void* userData | 用户自定义数据。 |
139| callback | 自定义弹窗显示之后的回调函数。 |
140
141**返回:**
142
143| 类型 | 说明 |
144| -- | -- |
145| int32_t | 错误码。<br>             [ARKUI_ERROR_CODE_NO_ERROR](capi-native-type-h.md#arkui_errorcode) 成功。<br>             [ARKUI_ERROR_CODE_PARAM_INVALID](capi-native-type-h.md#arkui_errorcode) 函数参数异常。 |
146
147### registerOnWillDisappear()
148
149```
150int32_t (*registerOnWillDisappear)(ArkUI_NativeDialogHandle handle, void* userData, void (*callback)(void* userData))
151```
152
153**描述:**
154
155
156注册自定义弹窗关闭之前的回调函数。
157
158> **说明:**
159>
160> registerOnWillDisappear方法需要在调用[show](capi-arkui-nativemodule-arkui-nativedialogapi-1.md#show)之前调用。
161
162**起始版本:** 19
163
164**参数:**
165
166| 参数项 | 描述 |
167| -- | -- |
168| [ArkUI_NativeDialogHandle](capi-arkui-nativemodule-arkui-nativedialog8h.md) handle | 指向自定义弹窗控制器的指针。 |
169| void* userData | 用户自定义数据。 |
170| callback | 自定义弹窗关闭之前的回调函数。 |
171
172**返回:**
173
174| 类型 | 说明 |
175| -- | -- |
176| int32_t | 错误码。<br>             [ARKUI_ERROR_CODE_NO_ERROR](capi-native-type-h.md#arkui_errorcode) 成功。<br>             [ARKUI_ERROR_CODE_PARAM_INVALID](capi-native-type-h.md#arkui_errorcode) 函数参数异常。 |
177
178### registerOnDidDisappear()
179
180```
181int32_t (*registerOnDidDisappear)(ArkUI_NativeDialogHandle handle, void* userData, void (*callback)(void* userData))
182```
183
184**描述:**
185
186
187注册自定义弹窗关闭之后的回调函数。
188
189> **说明:**
190>
191> registerOnDidDisappear方法需要在调用[show](capi-arkui-nativemodule-arkui-nativedialogapi-1.md#show)之前调用。
192
193**起始版本:** 19
194
195**参数:**
196
197| 参数项 | 描述 |
198| -- | -- |
199| [ArkUI_NativeDialogHandle](capi-arkui-nativemodule-arkui-nativedialog8h.md) handle | 指向自定义弹窗控制器的指针。 |
200| void* userData | 用户自定义数据。 |
201| callback | 自定义弹窗关闭之后的回调函数。 |
202
203**返回:**
204
205| 类型 | 说明 |
206| -- | -- |
207| int32_t | 错误码。<br>             [ARKUI_ERROR_CODE_NO_ERROR](capi-native-type-h.md#arkui_errorcode) 成功。<br>             [ARKUI_ERROR_CODE_PARAM_INVALID](capi-native-type-h.md#arkui_errorcode) 函数参数异常。 |
208
209### setBorderWidth()
210
211```
212int32_t (*setBorderWidth)(ArkUI_NativeDialogHandle handle, float top, float right, float bottom, float left, ArkUI_LengthMetricUnit unit)
213```
214
215**描述:**
216
217
218设置自定义弹窗的边框宽度。
219
220> **说明:**
221>
222> setBorderWidth方法需要在调用[show](capi-arkui-nativemodule-arkui-nativedialogapi-1.md#show)之前调用。
223
224**起始版本:** 19
225
226**参数:**
227
228| 参数项                                                                                | 描述 |
229|------------------------------------------------------------------------------------| -- |
230| [ArkUI_NativeDialogHandle](capi-arkui-nativemodule-arkui-nativedialog8h.md) handle | 指向自定义弹窗控制器的指针。 |
231| float top                                                                          | 上边框的宽度。 |
232| float right                                                                        | 右边框的宽度。 |
233| float bottom                                                                       | 下边框的宽度。 |
234| float left                                                                         | 左边框的宽度。 |
235| [ArkUI_LengthMetricUnit](capi-native-type-h.md#arkui_lengthmetricunit) unit        | 指定宽度单位,默认为vp。 |
236
237**返回:**
238
239| 类型 | 说明 |
240| -- | -- |
241| int32_t | 错误码。<br>             [ARKUI_ERROR_CODE_NO_ERROR](capi-native-type-h.md#arkui_errorcode) 成功。<br>             [ARKUI_ERROR_CODE_PARAM_INVALID](capi-native-type-h.md#arkui_errorcode) 函数参数异常。 |
242
243### setBorderColor()
244
245```
246int32_t (*setBorderColor)(ArkUI_NativeDialogHandle handle, uint32_t top, uint32_t right, uint32_t bottom, uint32_t left)
247```
248
249**描述:**
250
251
252设置自定义弹窗的边框颜色。
253
254> **说明:**
255>
256> setBorderColor方法需要在调用[show](capi-arkui-nativemodule-arkui-nativedialogapi-1.md#show)之前调用。
257
258**起始版本:** 19
259
260**参数:**
261
262| 参数项 | 描述 |
263| -- | -- |
264| [ArkUI_NativeDialogHandle](capi-arkui-nativemodule-arkui-nativedialog8h.md) handle | 指向自定义弹窗控制器的指针。 |
265|  uint32_t top | 上边框的颜色。 |
266|  uint32_t right | 右边框的颜色。 |
267|  uint32_t bottom | 下边框的颜色。 |
268|  uint32_t left | 左边框的颜色。 |
269
270**返回:**
271
272| 类型 | 说明 |
273| -- | -- |
274| int32_t | 错误码。<br>             [ARKUI_ERROR_CODE_NO_ERROR](capi-native-type-h.md#arkui_errorcode) 成功。<br>             [ARKUI_ERROR_CODE_PARAM_INVALID](capi-native-type-h.md#arkui_errorcode) 函数参数异常。 |
275
276### setBorderStyle()
277
278```
279int32_t (*setBorderStyle)(ArkUI_NativeDialogHandle handle, int32_t top, int32_t right, int32_t bottom, int32_t left)
280```
281
282**描述:**
283
284
285设置自定义弹窗的边框样式。
286
287> **说明:**
288>
289> setBorderStyle方法需要在调用[show](capi-arkui-nativemodule-arkui-nativedialogapi-1.md#show)之前调用。
290
291**起始版本:** 19
292
293**参数:**
294
295| 参数项 | 描述 |
296| -- | -- |
297| [ArkUI_NativeDialogHandle](capi-arkui-nativemodule-arkui-nativedialog8h.md) handle | 指向自定义弹窗控制器的指针。 |
298|  int32_t top | 上边框的样式。 |
299|  int32_t right | 右边框的样式。 |
300|  int32_t bottom | 下边框的样式。 |
301|  int32_t left | 左边框的样式。 |
302
303**返回:**
304
305| 类型 | 说明 |
306| -- | -- |
307| int32_t | 错误码。<br>             [ARKUI_ERROR_CODE_NO_ERROR](capi-native-type-h.md#arkui_errorcode) 成功。<br>             [ARKUI_ERROR_CODE_PARAM_INVALID](capi-native-type-h.md#arkui_errorcode) 函数参数异常。 |
308
309### setWidth()
310
311```
312int32_t (*setWidth)(ArkUI_NativeDialogHandle handle, float width, ArkUI_LengthMetricUnit unit)
313```
314
315**描述:**
316
317
318设置自定义弹窗的背板宽度。
319
320> **说明:**
321>
322> setWidth方法需要在调用[show](capi-arkui-nativemodule-arkui-nativedialogapi-1.md#show)之前调用。
323
324**起始版本:** 19
325
326**参数:**
327
328| 参数项 | 描述 |
329| -- | -- |
330| [ArkUI_NativeDialogHandle](capi-arkui-nativemodule-arkui-nativedialog8h.md) handle | 指向自定义弹窗控制器的指针。 |
331|  float width | 背板宽度。 |
332|  [ArkUI_LengthMetricUnit](capi-native-type-h.md#arkui_lengthmetricunit) unit | 指定宽度的单位,默认为vp。 |
333
334**返回:**
335
336| 类型 | 说明 |
337| -- | -- |
338| int32_t | 错误码。<br>             [ARKUI_ERROR_CODE_NO_ERROR](capi-native-type-h.md#arkui_errorcode) 成功。<br>             [ARKUI_ERROR_CODE_PARAM_INVALID](capi-native-type-h.md#arkui_errorcode) 函数参数异常。 |
339
340### setHeight()
341
342```
343int32_t (*setHeight)(ArkUI_NativeDialogHandle handle, float height, ArkUI_LengthMetricUnit unit)
344```
345
346**描述:**
347
348
349设置自定义弹窗的背板高度。
350
351> **说明:**
352>
353> setHeight方法需要在调用[show](capi-arkui-nativemodule-arkui-nativedialogapi-1.md#show)之前调用。
354
355**起始版本:** 19
356
357**参数:**
358
359| 参数项 | 描述 |
360| -- | -- |
361| [ArkUI_NativeDialogHandle](capi-arkui-nativemodule-arkui-nativedialog8h.md) handle | 指向自定义弹窗控制器的指针。 |
362|  float height | 背板高度。 |
363|  [ArkUI_LengthMetricUnit](capi-native-type-h.md#arkui_lengthmetricunit) unit | 指定高度的单位,默认为vp。 |
364
365**返回:**
366
367| 类型 | 说明 |
368| -- | -- |
369| int32_t | 错误码。<br>             [ARKUI_ERROR_CODE_NO_ERROR](capi-native-type-h.md#arkui_errorcode) 成功。<br>             [ARKUI_ERROR_CODE_PARAM_INVALID](capi-native-type-h.md#arkui_errorcode) 函数参数异常。 |
370
371### setShadow()
372
373```
374int32_t (*setShadow)(ArkUI_NativeDialogHandle handle, ArkUI_ShadowStyle shadow)
375```
376
377**描述:**
378
379
380设置自定义弹窗的背板阴影。
381
382> **说明:**
383>
384> setShadow方法需要在调用[show](capi-arkui-nativemodule-arkui-nativedialogapi-1.md#show)之前调用。
385
386**起始版本:** 19
387
388**参数:**
389
390| 参数项                                                                                | 描述 |
391|------------------------------------------------------------------------------------| -- |
392| [ArkUI_NativeDialogHandle](capi-arkui-nativemodule-arkui-nativedialog8h.md) handle | 指向自定义弹窗控制器的指针。 |
393| [ArkUI_ShadowStyle](capi-native-type-h.md#arkui_shadowstyle) shadow                | 背板阴影样式,枚举值。 |
394
395**返回:**
396
397| 类型 | 说明 |
398| -- | -- |
399| int32_t | 错误码。<br>             [ARKUI_ERROR_CODE_NO_ERROR](capi-native-type-h.md#arkui_errorcode) 成功。<br>             [ARKUI_ERROR_CODE_PARAM_INVALID](capi-native-type-h.md#arkui_errorcode) 函数参数异常。 |
400
401### setCustomShadow()
402
403```
404int32_t (*setCustomShadow)(ArkUI_NativeDialogHandle handle, const ArkUI_AttributeItem* customShadow)
405```
406
407**描述:**
408
409
410设置自定义弹窗的背板阴影。
411
412> **说明:**
413>
414> setCustomShadow方法需要在调用[show](capi-arkui-nativemodule-arkui-nativedialogapi-1.md#show)之前调用。
415
416**起始版本:** 19
417
418**参数:**
419
420| 参数项                                                                                | 描述 |
421|------------------------------------------------------------------------------------| -- |
422| [ArkUI_NativeDialogHandle](capi-arkui-nativemodule-arkui-nativedialog8h.md) handle | 指向自定义弹窗控制器的指针。 |
423| const [ArkUI_AttributeItem](capi-arkui-nativemodule-arkui-attributeitem.md)* customShadow                                        | 自定义阴影参数,格式与[ArkUI_NodeAttributeType](./capi-native-node-h.md#arkui_nodeattributetype)中的NODE_SHADOW属性一致。 |
424
425**返回:**
426
427| 类型 | 说明 |
428| -- | -- |
429| int32_t | 错误码。<br>             [ARKUI_ERROR_CODE_NO_ERROR](capi-native-type-h.md#arkui_errorcode) 成功。<br>             [ARKUI_ERROR_CODE_PARAM_INVALID](capi-native-type-h.md#arkui_errorcode) 函数参数异常。 |
430
431### setBackgroundBlurStyle()
432
433```
434int32_t (*setBackgroundBlurStyle)(ArkUI_NativeDialogHandle handle, ArkUI_BlurStyle blurStyle)
435```
436
437**描述:**
438
439
440设置自定义弹窗的背板模糊材质。
441
442> **说明:**
443>
444> setBackgroundBlurStyle方法需要在调用[show](capi-arkui-nativemodule-arkui-nativedialogapi-1.md#show)之前调用。
445
446**起始版本:** 19
447
448**参数:**
449
450| 参数项                                                                                | 描述 |
451|------------------------------------------------------------------------------------| -- |
452| [ArkUI_NativeDialogHandle](capi-arkui-nativemodule-arkui-nativedialog8h.md) handle | 指向自定义弹窗控制器的指针。 |
453| [ArkUI_BlurStyle](capi-native-type-h.md#arkui_blurstyle) blurStyle                 | 背板模糊材质,枚举值。 |
454
455**返回:**
456
457| 类型 | 说明 |
458| -- | -- |
459| int32_t | 错误码。<br>             [ARKUI_ERROR_CODE_NO_ERROR](capi-native-type-h.md#arkui_errorcode) 成功。<br>             [ARKUI_ERROR_CODE_PARAM_INVALID](capi-native-type-h.md#arkui_errorcode) 函数参数异常。 |
460
461### setKeyboardAvoidMode()
462
463```
464int32_t (*setKeyboardAvoidMode)(ArkUI_NativeDialogHandle handle, ArkUI_KeyboardAvoidMode keyboardAvoidMode)
465```
466
467**描述:**
468
469
470设置自定义弹窗避让键盘模式。
471
472> **说明:**
473>
474> setKeyboardAvoidMode方法需要在调用[show](capi-arkui-nativemodule-arkui-nativedialogapi-1.md#show)之前调用。
475
476**起始版本:** 19
477
478**参数:**
479
480| 参数项                                                                                        | 描述 |
481|--------------------------------------------------------------------------------------------| -- |
482| [ArkUI_NativeDialogHandle](capi-arkui-nativemodule-arkui-nativedialog8h.md) handle         | 指向自定义弹窗控制器的指针。 |
483| [ArkUI_KeyboardAvoidMode](capi-native-type-h.md#arkui_keyboardavoidmode) keyboardAvoidMode | 避让键盘模式,枚举值。 |
484
485**返回:**
486
487| 类型 | 说明 |
488| -- | -- |
489| int32_t | 错误码。<br>             [ARKUI_ERROR_CODE_NO_ERROR](capi-native-type-h.md#arkui_errorcode) 成功。<br>             [ARKUI_ERROR_CODE_PARAM_INVALID](capi-native-type-h.md#arkui_errorcode) 函数参数异常。 |
490
491### enableHoverMode()
492
493```
494int32_t (*enableHoverMode)(ArkUI_NativeDialogHandle handle, bool enableHoverMode)
495```
496
497**描述:**
498
499
500设置自定义弹窗是否响应悬停态。
501
502> **说明:**
503>
504> enableHoverMode方法需要在调用[show](capi-arkui-nativemodule-arkui-nativedialogapi-1.md#show)之前调用。
505
506**起始版本:** 19
507
508**参数:**
509
510| 参数项 | 描述 |
511| -- | -- |
512| [ArkUI_NativeDialogHandle](capi-arkui-nativemodule-arkui-nativedialog8h.md) handle | 指向自定义弹窗控制器的指针。 |
513|  bool enableHoverMode | 是否响应悬停态,默认false。true表示响应悬停态,false表示不响应悬停态。 |
514
515**返回:**
516
517| 类型 | 说明 |
518| -- | -- |
519| int32_t | 错误码。<br>             [ARKUI_ERROR_CODE_NO_ERROR](capi-native-type-h.md#arkui_errorcode) 成功。<br>             [ARKUI_ERROR_CODE_PARAM_INVALID](capi-native-type-h.md#arkui_errorcode) 函数参数异常。 |
520
521### setHoverModeArea()
522
523```
524int32_t (*setHoverModeArea)(ArkUI_NativeDialogHandle handle, ArkUI_HoverModeAreaType hoverModeAreaType)
525```
526
527**描述:**
528
529
530设置悬停态下自定义弹窗默认展示区域。
531
532> **说明:**
533>
534> setHoverModeArea方法需要在调用[show](capi-arkui-nativemodule-arkui-nativedialogapi-1.md#show)之前调用。
535
536**起始版本:** 19
537
538**参数:**
539
540| 参数项                                                                                        | 描述 |
541|--------------------------------------------------------------------------------------------| -- |
542| [ArkUI_NativeDialogHandle](capi-arkui-nativemodule-arkui-nativedialog8h.md) handle         | 指向自定义弹窗控制器的指针。 |
543| [ArkUI_HoverModeAreaType](capi-native-type-h.md#arkui_hovermodeareatype) hoverModeAreaType | 悬停态区域,枚举值。 |
544
545**返回:**
546
547| 类型 | 说明 |
548| -- | -- |
549| int32_t | 错误码。<br>             [ARKUI_ERROR_CODE_NO_ERROR](capi-native-type-h.md#arkui_errorcode) 成功。<br>             [ARKUI_ERROR_CODE_PARAM_INVALID](capi-native-type-h.md#arkui_errorcode) 函数参数异常。 |
550
551### setFocusable()
552
553```
554int32_t (*setFocusable)(ArkUI_NativeDialogHandle handle, bool focusable)
555```
556
557**描述:**
558
559
560设置自定义弹窗是否获取焦点。
561
562> **说明:**
563>
564> setFocusable方法需要在调用[show](capi-arkui-nativemodule-arkui-nativedialogapi-1.md#show)之前调用。
565
566**起始版本:** 19
567
568**参数:**
569
570| 参数项 | 描述 |
571| -- | -- |
572| [ArkUI_NativeDialogHandle](capi-arkui-nativemodule-arkui-nativedialog8h.md) handle | 指向自定义弹窗控制器的指针。 |
573|  bool focusable | 自定义弹窗是否获取焦点。true表示自动获取焦点,false表示不自动获取焦点。默认值:true |
574
575**返回:**
576
577| 类型 | 说明 |
578| -- | -- |
579| int32_t | 错误码。<br>             [ARKUI_ERROR_CODE_NO_ERROR](capi-native-type-h.md#arkui_errorcode) 成功。<br>             [ARKUI_ERROR_CODE_PARAM_INVALID](capi-native-type-h.md#arkui_errorcode) 函数参数异常。 |
580
581### setBackgroundBlurStyleOptions()
582
583```
584int32_t (*setBackgroundBlurStyleOptions)(ArkUI_NativeDialogHandle handle, const ArkUI_AttributeItem* backgroundBlurStyleOptions)
585```
586
587**描述:**
588
589
590设置自定义弹窗的背景模糊效果。
591
592> **说明:**
593>
594> setBackgroundBlurStyleOptions方法需要在调用[show](capi-arkui-nativemodule-arkui-nativedialogapi-1.md#show)之前调用。
595
596**起始版本:** 19
597
598**参数:**
599
600| 参数项 | 描述 |
601| -- | -- |
602| [ArkUI_NativeDialogHandle](capi-arkui-nativemodule-arkui-nativedialog8h.md) handle | 指向自定义弹窗控制器的指针。 |
603|  const [ArkUI_AttributeItem](capi-arkui-nativemodule-arkui-attributeitem.md)* backgroundBlurStyleOptions | 背景模糊效果。参数[ArkUI_AttributeItem](capi-arkui-nativemodule-arkui-attributeitem.md)格式:<br>        .value[0].i32 表示深浅色模式,取[ArkUI_ColorMode](capi-native-type-h.md#arkui_colormode)枚举值。<br>        .value[1]?.i32 表示取色模式,取[ArkUI_AdaptiveColor](capi-native-type-h.md#arkui_adaptivecolor)枚举值。<br>        .value[2]?.f32 表示模糊效果程度,取[0.0,1.0]范围内的值。<br>        .value[3]?.u32 表示灰阶模糊参数,对黑色的提亮程度,有效值范围为[0,127]。<br>        .value[4]?.u32 表示灰阶模糊参数,对白色的压暗程度,有效值范围为[0,127]。<br>        .value[5]?.i32 表示模糊激活策略,取[ArkUI_BlurStyleActivePolicy](capi-native-type-h.md#arkui_blurstyleactivepolicy)枚举值。<br>        .value[6]?.u32 表示窗口失焦后,窗口内控件模糊效果会被移除,此时控件背板的颜色,0xargb类型。 |
604
605**返回:**
606
607| 类型 | 说明 |
608| -- | -- |
609| int32_t | 错误码。<br>             [ARKUI_ERROR_CODE_NO_ERROR](capi-native-type-h.md#arkui_errorcode) 成功。<br>             [ARKUI_ERROR_CODE_PARAM_INVALID](capi-native-type-h.md#arkui_errorcode) 函数参数异常。 |
610
611### setBackgroundEffect()
612
613```
614int32_t (*setBackgroundEffect)(ArkUI_NativeDialogHandle handle, const ArkUI_AttributeItem* backgroundEffect)
615```
616
617**描述:**
618
619
620设置自定义弹窗的背景效果参数。
621
622> **说明:**
623>
624> setBackgroundEffect方法需要在调用[show](capi-arkui-nativemodule-arkui-nativedialogapi-1.md#show)之前调用。
625
626**起始版本:** 19
627
628**参数:**
629
630| 参数项 | 描述 |
631| -- | -- |
632| [ArkUI_NativeDialogHandle](capi-arkui-nativemodule-arkui-nativedialog8h.md) handle | 指向自定义弹窗控制器的指针。 |
633|  const [ArkUI_AttributeItem](capi-arkui-nativemodule-arkui-attributeitem.md)* backgroundEffect | 背景效果参数。参数[ArkUI_AttributeItem](capi-arkui-nativemodule-arkui-attributeitem.md)格式:<br>        .value[0].f32 表示模糊半径,单位为vp。<br>        .value[1]?.f32 表示饱和度。<br>        .value[2]?.f32 表示亮度。<br>        .value[3]?.u32 表示颜色,0xargb类型。<br>        .value[4]?.i32 表示取色模式,取[ArkUI_AdaptiveColor](capi-native-type-h.md#arkui_adaptivecolor)枚举值。<br>        .value[5]?.u32 表示灰阶模糊参数,对黑色的提亮程度,有效值范围为[0,127]。<br>        .value[6]?.u32 表示灰阶模糊参数,对白色的压暗程度,有效值范围为[0,127]。<br>        .value[7]?.i32 表示模糊激活策略,取[ArkUI_BlurStyleActivePolicy](capi-native-type-h.md#arkui_blurstyleactivepolicy)枚举值。<br>        .value[8]?.u32 表示窗口失焦后,窗口内控件模糊效果会被移除,此时控件背板的颜色,0xargb类型。 |
634
635**返回:**
636
637| 类型 | 说明 |
638| -- | -- |
639| int32_t | 错误码。<br>             [ARKUI_ERROR_CODE_NO_ERROR](capi-native-type-h.md#arkui_errorcode) 成功。<br>             [ARKUI_ERROR_CODE_PARAM_INVALID](capi-native-type-h.md#arkui_errorcode) 函数参数异常。 |
640
641
642