Android之属性动画

来源:互联网 发布:微销宝是什么软件 编辑:程序博客网 时间:2024/06/05 02:36
ObjectAnimator translationX=ObjectAnimator.ofFloat(ivimg,"translationX",0f,200f);ObjectAnimator rotationr=ObjectAnimator.ofFloat(ivimg,"rotation",0f,360f);ObjectAnimator alpha=ObjectAnimator.ofFloat(ivimg,"alpha",1f,0f);ObjectAnimator scaleY=ObjectAnimator.ofFloat(ivimg,"scaleY",1f,3f);ObjectAnimator scaleX=ObjectAnimator.ofFloat(ivimg,"scaleX",1f,3f,1f);AnimatorSet animatorSet=new AnimatorSet();animatorSet.play(alpha).with(scaleY).with(scaleX).with(rotationr).with(translationX);animatorSet.setDuration(2000);animatorSet.start();
原创粉丝点击