誰能告訴我爲什麼這個動畫不開始?我已經嘗試將代碼放入onAnimationStart監聽器中,並且它永遠不會被調用!沒有錯誤,它只是從來沒有發生..我一直盯着這個小時!動畫未啓動! (安卓)
Animation bRegisterAnimation = fadeView(1,0,0);
bRegisterAnimation.setAnimationListener(new AnimationListener() {
public void onAnimationStart(Animation arg0) {}
public void onAnimationRepeat(Animation arg0) {}
public void onAnimationEnd(Animation arg0) {
bRegister.clearAnimation();
bRegister.setVisibility(View.INVISIBLE);
}
});
bRegister.setAnimation(bRegisterAnimation);
這裏是fadeView功能:
public Animation fadeView(float startA, float endA, int delay) {
Animation animation = new AlphaAnimation(startA,endA);
animation.setDuration(1000);
animation.setStartOffset(delay);
return animation;
}
的感謝!
作品像一個魅力,謝謝! – user1118042 2012-02-08 04:45:03