1# ArkUI_NativeAnimateAPI_1 2 3## 概述 4 5ArkUI提供的Native侧动画接口集合。 6 7**起始版本:** 12 8 9**相关模块:** [ArkUI_NativeModule](capi-arkui-nativemodule.md) 10 11**所在头文件:** [native_animate.h](capi-native-animate-h.md) 12 13## 汇总 14 15### 成员函数 16 17| 名称 | 描述 | 18| -- | -- | 19| [int32_t (\*animateTo)(ArkUI_ContextHandle context, ArkUI_AnimateOption* option, ArkUI_ContextCallback* update,ArkUI_AnimateCompleteCallback* complete)](#animateto) | 显式动画接口。 | 20| [int32_t (\*keyframeAnimateTo)(ArkUI_ContextHandle context, ArkUI_KeyframeAnimateOption* option)](#keyframeanimateto) | 关键帧动画接口。 | 21| [ArkUI_AnimatorHandle (\*createAnimator)(ArkUI_ContextHandle context, ArkUI_AnimatorOption* option)](#createanimator) | 创建animator动画对象。 | 22| [void (\*disposeAnimator)(ArkUI_AnimatorHandle animatorHandle)](#disposeanimator) | 销毁animator动画对象。 | 23 24## 成员函数说明 25 26### animateTo() 27 28``` 29int32_t (*animateTo)(ArkUI_ContextHandle context, ArkUI_AnimateOption* option, ArkUI_ContextCallback* update,ArkUI_AnimateCompleteCallback* complete) 30``` 31 32**描述:** 33 34 35显式动画接口。 36 37> **说明:** 38> 39> event闭包中要设置的组件属性,必须在其之前设置过。 40 41**参数:** 42 43| 参数项 | 描述 | 44|-----------------------------------------------------------------------------------------------------| -- | 45| [ArkUI_ContextHandle](capi-arkui-nativemodule-arkui-context8h.md) context | UIContext实例。 | 46| [ArkUI_AnimateOption](capi-arkui-nativemodule-arkui-animateoption.md)* option | 设置动画效果相关参数。 | 47| [ArkUI_ContextCallback](capi-arkui-nativemodule-arkui-contextcallback.md)* update | 指定动效的闭包函数,在闭包函数中导致的状态变化系统会自动插入过渡动画。 | 48| [ArkUI_AnimateCompleteCallback](capi-arkui-nativemodule-arkui-animatecompletecallback.md)* complete | 设置动画播放完成回调参数。 | 49 50**返回:** 51 52| 类型 | 说明 | 53| -- | -- | 54| 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) 函数参数异常。 | 55 56### keyframeAnimateTo() 57 58``` 59int32_t (*keyframeAnimateTo)(ArkUI_ContextHandle context, ArkUI_KeyframeAnimateOption* option) 60``` 61 62**描述:** 63 64 65关键帧动画接口。 66 67**参数:** 68 69| 参数项 | 描述 | 70|---------------------------------------------------------------------------| -- | 71| [ArkUI_ContextHandle](capi-arkui-nativemodule-arkui-context8h.md) context | UIContext实例。 | 72| [ArkUI_KeyframeAnimateOption](capi-arkui-nativemodule-arkui-keyframeanimateoption.md)* option | 关键帧动画参数。 | 73 74**返回:** 75 76| 类型 | 说明 | 77| -- | -- | 78| 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) 函数参数异常。 | 79 80### createAnimator() 81 82``` 83ArkUI_AnimatorHandle (*createAnimator)(ArkUI_ContextHandle context, ArkUI_AnimatorOption* option) 84``` 85 86**描述:** 87 88 89创建animator动画对象。 90 91**参数:** 92 93| 参数项 | 描述 | 94|---------------------------------------------------------------------------| -- | 95| [ArkUI_ContextHandle](capi-arkui-nativemodule-arkui-context8h.md) context | UIContext实例。 | 96| [ArkUI_AnimatorOption](capi-arkui-nativemodule-arkui-animatoroption.md)* option | animator动画参数。 | 97 98**返回:** 99 100| 类型 | 说明 | 101|--------------------------| -- | 102| [ArkUI_AnimatorHandle](capi-arkui-nativemodule-arkui-animator8h.md) | animator动画对象指针。函数参数异常时返回NULL。 | 103 104### disposeAnimator() 105 106``` 107void (*disposeAnimator)(ArkUI_AnimatorHandle animatorHandle) 108``` 109 110**描述:** 111 112 113销毁animator动画对象。 114 115**参数:** 116 117| 参数项 | 描述 | 118|-----|----| 119| [ArkUI_AnimatorHandle](capi-arkui-nativemodule-arkui-animator8h.md) animatorHandle | animator动画对象。 | 120