RotateAnimation 旋转动画
ImageView img;
img=new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
img.setDuration(TIME_MINISECONDS_DURATION_RECOGNIZE);
img.setInterpolator(new LinearInterpolator());
img.setRepeatCount(Animation.INFINITE);
//去掉动画
img.clearAnimation();
AlphaAnimation 淡入淡出动画
// Change alpha from fully visible to
final Animation animation = new AlphaAnimation(1, 0); // invisible
animation.setDuration(TIME_MINISECONDS_MIC_FLICKER); // duration - 1/5 a second
animation.setInterpolator(new LinearInterpolator()); // do not alter animation rate
animation.setRepeatCount(Animation.INFINITE); // Repeat animation infinitely
animation.setRepeatMode(Animation.REVERSE); //
img.setAnimation(animation);
//去掉动画
img.clearAnimation();
TranslateAnimaiton 位移动画
final TranslateAnimation animation = new TranslateAnimation(0, 150,0, 0);
animation.setDuration(2000);//设置动画持续时间
animation.setRepeatCount(2);//设置重复次数
animation.setRepeatMode(Animation.REVERSE);//设置反方向执行
DrawableAnimation 帧动画
AnimationDrawable frameAnim = new AnimationDrawable();
frameAnim.setOneShot(false);
frameAnim.addFrame(getResources().getDrawable(R.drawable.ren0006), 70);
frameAnim.addFrame(getResources().getDrawable(R.drawable.ren0007), 70);
frameAnim.addFrame(getResources().getDrawable(R.drawable.ren0008), 70);
frameAnim.addFrame(getResources().getDrawable(R.drawable.ren0009), 70);
frameAnim.addFrame(getResources().getDrawable(R.drawable.ren0010), 70);
frameAnim.addFrame(getResources().getDrawable(R.drawable.ren0011), 70);
frameAnim.addFrame(getResources().getDrawable(R.drawable.ren0012), 70);
frameAnim.addFrame(getResources().getDrawable(R.drawable.ren0013), 70);
frameAnim.addFrame(getResources().getDrawable(R.drawable.ren0014), 70);
frameAnim.addFrame(getResources().getDrawable(R.drawable.ren0015), 70);
img.setBackground(frameAnim);
frameAnim.start();