帧动画
补间动画
- 组件有原始状态变化到结束状态,自动生成的动画效果。
位移动画
TranslateAnimation ta =new TranslateAnimation(10,100,20,200);
sa.setRepeatCount(1);
sa.setRepeatMode(Animation.REVERSE);
sa.setDuration(2000);
sa.setFillAfter(true);
iv.startAnimation(sa);
缩放动画
ScaleAnimation sa =new ScaleAnimation(0.5f, 2f, 0.5f, 2f,iv.getHeight()/2,iv.getWidth()/2);
透明动画
AlphaAnimation aa=new AlphaAnimation(0, 1);
旋转动画
ra=new RotateAnimation(20, 180, 50, 100);
set
AnimationSet set=new AnimationSet(false);
属性动画
ObjectAnimator oa =ObjectAnimator.ofFloat(iv, "translation", 10,20,70,68);
AnimatorSet set =new AnimatorSet();
set.playSequentially(oa1,oa2,oa3);
set.playTogether(items);