private void addAnimation(){
img_show.startAnimation(scaleAnimation());
// img_show.clearAnimation(); //停止動畫
}
/**
* 圖片自動循環縮放
* @return
*/
public static ScaleAnimation scaleAnimation() {
ScaleAnimation scaleAnimation = new ScaleAnimation(1.0f, 0.5f, 1.0f, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
scaleAnimation.setDuration(900); //動畫執行時間
scaleAnimation.setRepeatCount(-1); //-1表示重複執行動畫
scaleAnimation.setRepeatMode(Animation.REVERSE); //重複 縮小和放大效果
return scaleAnimation;
}