属性动画
程序员文章站
2022-01-28 21:53:29
...
属性动画——平移
AnimatorSet animatorSet = new AnimatorSet();
/*int colorA = Color.parseColor("#ff0000");
int colorB = Color.parseColor("#00ff00");
int colorC = Color.parseColor("#00ffff");*/
ObjectAnimator objectAnimator = ObjectAnimator.ofInt(anmitor, "backgroundColor", colorA,colorB,colorC);
ObjectAnimator translationX = ObjectAnimator.ofFloat(anmitor, "translationX", 0, 850f);
ObjectAnimator translationY = ObjectAnimator.ofFloat(anmitor, "translationY", 0, 1500f);
animatorSet.playTogether(translationX,translationY,objectAnimator);
animatorSet.setDuration(5000);
animatorSet.start();
上一篇: 爬取大众点评网的酒店信息
下一篇: 动画