我想讓閃爍的圖像按鈕。Android淡入淡出
我正在考慮使用淡入和淡出,但我不能一起使用它在1圖像按鈕。下面的代碼閃爍一次:
Animation fadeIn = new AlphaAnimation(0, 1);
fadeIn.setInterpolator(new DecelerateInterpolator());
fadeIn.setDuration(1000);
Animation fadeOut = new AlphaAnimation(1, 0);
fadeOut.setInterpolator(new AccelerateInterpolator());
fadeOut.setStartOffset(1000);
fadeOut.setDuration(1000);
AnimationSet animation = new AnimationSet(false);
animation.addAnimation(fadeIn);
animation.addAnimation(fadeOut);
this.setAnimation(animation);`
閱讀關於['AnimationListener.onAnimationEnd'](http://developer.android.com/reference/android/view/animation/Animation.AnimationListener.html#onAnimationEnd%28android.view.animation.Animation%29) –