Skip to content

动画重复模式

属性动画重复模式

Defines what this animation should do when it reaches the end. This setting is applied only when the repeat count is either greater than 0 or INFINITE. Defaults to RESTART.

  • restart
  • reverse
  • infinite

属性动画重复模式的值定义:

点击查看源码
js
export const ES_ANIMATION_REPEAT_MODE_RESTART = 1;
export const ES_ANIMATION_REPEAT_MODE_REVERSE = 2;
export const ES_ANIMATION_REPEAT_MODE_INFINITE = -1;

属性动画重复次数:

Sets how many times the animation should be repeated. If the repeat count is 0, the animation is never repeated. If the repeat count is greater than 0 or INFINITE, the repeat mode will be taken into account. The repeat count is 0 by default.

示例代码

点击查看源码
vue
this.$refs.animation_view.objectAnimator2(
        "2",//自定义id
        ES_ANIMATION_VALUE_TYPE_FLOAT,
        ES_ANIMATION_PROPERTY_NAME_ALPHA,
        "0",
        "1",
        1000,
        -1,//动画重复模式
        0,//动画重复次数
        false,
        false,
        null,
      );