harmony 鸿蒙ArkUI_NativeAnimateAPI_1

  • 2025-06-12
  • 浏览 (6)

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 animator) 销毁animator动画对象。

结构体成员变量说明

animateTo

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

描述:

显式动画接口。

参数:

名称 描述
context UIContext实例。
option 设置动画效果相关参数。
update 指定动效的闭包函数,在闭包函数中导致的状态变化系统会自动插入过渡动画。
complete 设置动画播放完成回调参数。

注解:

event闭包中要设置的组件属性,必须在其之前设置过。

返回:

ARKUI_ERROR_CODE_NO_ERROR成功。 ARKUI_ERROR_CODE_PARAM_INVALID函数参数异常。

createAnimator

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

描述:

创建animator动画对象。

参数:

名称 描述
context UIContext实例。
option animator动画参数。

返回:

animator动画对象指针。函数参数异常时返回NULL。

disposeAnimator

void(* ArkUI_NativeAnimateAPI_1::disposeAnimator) (ArkUI_AnimatorHandle animator)

描述:

销毁animator动画对象。

参数:

名称 描述
animator animator动画对象。

keyframeAnimateTo

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

描述:

关键帧动画接口。

参数:

名称 描述
context UIContext实例。
option 关键帧动画参数。

返回:

ARKUI_ERROR_CODE_NO_ERROR成功。 ARKUI_ERROR_CODE_PARAM_INVALID函数参数异常。

你可能感兴趣的鸿蒙文章

harmony 鸿蒙ArkUI(方舟UI框架)

harmony 鸿蒙ARKUI_TextPickerCascadeRangeContent

harmony 鸿蒙ARKUI_TextPickerRangeContent

harmony 鸿蒙ArkUI_AnimateCompleteCallback

harmony 鸿蒙ArkUI_AttributeItem

harmony 鸿蒙ArkUI_ColorStop

harmony 鸿蒙ArkUI_ContextCallback

harmony 鸿蒙ArkUI_EventModule

harmony 鸿蒙ArkUI_ExpectedFrameRateRange

harmony 鸿蒙ArkUI_IntOffset

0  赞