Animation 和 Animator 区别

参考:http://www.2cto.com/kf/201501/373646.html

Animation 

tween动画(位移,缩放,旋转,渐变)祯动画

Animator

--ObjectAnimator 

ObjectAnimator.ofFloat(imageView, "translationY", 0f,200f).setDuration(1000).start();

///
PropertyValuesHolder p1=PropertyValuesHolder.ofFloat("rotation", 0,360f);
    PropertyValuesHolder p2=PropertyValuesHolder.ofFloat("translationX", 0f,200f);
    PropertyValuesHolder p3=PropertyValuesHolder.ofFloat("translationY", 0f,200f);
    ObjectAnimator.ofPropertyValuesHolder(imageView, p1,p2,p3).setDuration(1000).start();

--AnimationSet

ObjectAnimator animator1=ObjectAnimator.ofFloat(imageView, "rotation", 0,360f);
    ObjectAnimator animator2=ObjectAnimator.ofFloat(imageView, "translationX", 0,200f);
    ObjectAnimator animator3=ObjectAnimator.ofFloat(imageView, "translationY", 0,200f);
 
    AnimatorSet set=new AnimatorSet();
    //set.playTogether(animator1,animator2,animator3);
    set.playSequentially(animator1,animator2,animator3);
    set.setDuration(1000);
    set.start()
原文地址:https://www.cnblogs.com/wjw334/p/4450715.html