大家好..
我正在使用来自 Github 的非常好的动画技术.这个家伙为我们提供了非常好的文字效果,我喜欢无限次地使用其中的一些,不仅是在用户按下那个特定的按钮然后播放那个效果的时候。
这是我的代码:
private YoYo.YoYoString rope;
rope = YoYo.with(Techniques.RollOut)
.duration(1200)
.interpolate(new AccelerateDecelerateInterpolator())
.withListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {}
@Override
public void onAnimationEnd(Animator animation) {}
@Override
public void onAnimationCancel(Animator animation) {}
@Override
public void onAnimationRepeat(Animator animation) {}
}).playOn(mTarget);
当我要在 onAnimationEnd 方法中添加此代码时,这是我的问题:
animation.setRepeatCount(Animation.INFINITE);
会出现错误,它说:“方法 setRepeatCount(int) 未定义类型 Animator”。
如果您想继续,请转至 Github我提供的地址。 所以,简而言之,我想无限次地重复动画。
最佳答案
我使用这样的重复方法。
YoYo.with(Techniques.Tada)
.duration(700)
.repeat(Animation.INFINITE)
.playOn(...);
关于android - 如何无限次重复YoYo Animation Techniques?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30548553/