ObjectAnimator animator1 = ObjectAnimator.ofFloat(imageView, "translationX", 0F, 300F);//X轴平移旋转
        ObjectAnimator animator3 = ObjectAnimator.ofFloat(imageView, "rotation", 0F, 180F);//180度旋转

        animator1.setRepeatMode(ValueAnimator.REVERSE);
        animator1.setRepeatCount(ValueAnimator.INFINITE);
        animator3.setRepeatMode(ValueAnimator.REVERSE);
        animator3.setRepeatCount(ValueAnimator.INFINITE);

        AnimatorSet set = new AnimatorSet();
        set.play(animator3).with(animator1);
        set.setDuration(3000);
        set.start();


以上代码就可以实现让一个imageView平移的同时旋转  属性动画是可以真实的改变控件位置   补间动画则是 不改变控件的位置  只是一个视觉效果

posted on 2016-07-26 11:33  毕哥  阅读(184)  评论(0编辑  收藏  举报