openharmony 鸿蒙 capi-arkui-nativemodule-arkui-nativeanimateapi-1

2026-08-25 浏览 (1)

ArkUI_NativeAnimateAPI_1

typedef struct {...} ArkUI_NativeAnimateAPI_1

概述

ArkUI提供的Native侧动画接口集合。

起始版本: 12

相关模块: ArkUI_NativeModule

所在头文件: native_animate.h

汇总

成员函数

名称描述
int32_t (*animateTo)(ArkUI_ContextHandle context, ArkUI_AnimateOption* option, ArkUI_ContextCallback* update,ArkUI_AnimateCompleteCallback* complete)显式动画接口。
int32_t (*keyframeAnimateTo)(ArkUI_ContextHandle context, ArkUI_KeyframeAnimateOption* option)关键帧动画接口。
ArkUI_AnimatorHandle (*createAnimator)(ArkUI_ContextHandle context, ArkUI_AnimatorOption* option)创建animator动画对象。
void (*disposeAnimator)(ArkUI_AnimatorHandle animatorHandle)销毁animator动画对象。

成员函数说明

animateTo()

int32_t (*animateTo)(ArkUI_ContextHandle context, ArkUI_AnimateOption* option, ArkUI_ContextCallback* update,ArkUI_AnimateCompleteCallback* complete)

描述:

显式动画接口。

参数:

参数项描述
ArkUI_ContextHandle contextUIContext实例。
ArkUI_AnimateOption* option设置动画效果相关参数。
ArkUI_ContextCallback* update指定动效的闭包函数,在闭包函数中导致的状态变化系统会自动插入过渡动画。
说明:在闭包函数中要设置的组件属性,必须在其之前设置过。
ArkUI_AnimateCompleteCallback* complete设置动画播放完成回调参数。

返回:

类型说明
int32_t错误码。
ARKUI_ERROR_CODE_NO_ERROR 成功。
ARKUI_ERROR_CODE_PARAM_INVALID 函数参数异常。

keyframeAnimateTo()

int32_t (*keyframeAnimateTo)(ArkUI_ContextHandle context, ArkUI_KeyframeAnimateOption* option)

描述:

关键帧动画接口。

参数:

参数项描述
ArkUI_ContextHandle contextUIContext实例。
ArkUI_KeyframeAnimateOption* option关键帧动画参数。

返回:

类型说明
int32_t错误码。
ARKUI_ERROR_CODE_NO_ERROR 成功。
ARKUI_ERROR_CODE_PARAM_INVALID 函数参数异常。

createAnimator()

ArkUI_AnimatorHandle (*createAnimator)(ArkUI_ContextHandle context, ArkUI_AnimatorOption* option)

描述:

创建animator动画对象。

参数:

参数项描述
ArkUI_ContextHandle contextUIContext实例。
ArkUI_AnimatorOption* optionanimator动画参数。

返回:

类型说明
ArkUI_AnimatorHandleanimator动画对象指针。函数参数异常时返回NULL。

disposeAnimator()

void (*disposeAnimator)(ArkUI_AnimatorHandle animatorHandle)

描述:

销毁animator动画对象。

参数:

参数项描述
ArkUI_AnimatorHandle animatorHandleanimator动画对象。

你可能感兴趣的鸿蒙文章

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 鸿蒙 capi-native-node-h-nodeattributetype-layoutcomponent

openharmony 鸿蒙 js-apis-arkui-node

openharmony 鸿蒙 capi-native-node-h

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