我有一些代码正在使用 new Animation()
它有一个方法 applyTransformation
允许您创建自定义动画。
我已经创建了一个 new Animator()
但不知道将自定义动画放在哪里。
如何使用 Animator
创建自定义动画?
最佳答案
尝试这样的事情:
ValueAnimator anim = ValueAnimator.ofInt(0,100);
anim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
public void onAnimationUpdate(ValueAnimator animation) {
Integer value = (Integer) animation.getAnimatedValue();
Log.v(TAG, String.valueOf(value));
}
});
anim.setDuration(500);
anim.start();
关于android - 动画师相当于新动画中的 applyTransformation,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25318140/