资 源 简 介
android图片旋转、淡入淡出、缩放效果、移动效果示例,先来看下截图的运行效果,单击对应的按钮,即可看到效果,淡入淡出之类的,图片旋转之类的。
图片旋转的代码如下:
rotateAnimation.setDuration(5000);
animationSet.addAnimation(rotateAnimation);
image.startAnimation(animationSet);
淡入淡出效果:
AnimationSet animationSet = new AnimationSet(true);
animationSet.setInterpolator(new AccelerateInterpolator());
AlphaAnimation alphaAnimation = new AlphaAnimation(1, 0);
RotateAnimation rotateAnimation =
new RotateAnimation(0, 360,
Animation.RELATIVE_TO_PARENT, 1f,
Animation.RELATIVE_TO_PARENT, 0f);
animationSet.addAnimation(alphaAnimation);
animationSet.addAnimation(rotateAnimation);
alphaAnimation.setDuration(3000);
image.startAnimation(animationSet);
animationSet.setRepeatCount(4);