Re: [問題] Animation連續播放停頓的問題
可以試試下面方法,然後am_in 一樣在onAnimationEnd呼叫
am_out.startNow(); ,然後 setRepeatCount( -1 )應該可以拿掉了
am_out.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationRepeat(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
am_in.startNow();
}
});
※ 引述《sweet00914 (別理我)》之銘言:
: 請問各位大大的一個問題,就是我想做出一個效果-
: 多張圖片無縫式連續播放。
: 目前我測試兩張圖片來無縫式播放,程式碼如下:
: //Out的動畫
: am_out=new TranslateAnimation(0, 800, 0, 0);
: am_out.setDuration( 5000 );
: am_out.setRepeatCount( -1 );
: img1.setAnimation(am_out);
: am_out.startNow();
: //In的動畫
: am_in=new TranslateAnimation(-800, 0, 0, 0);
: am_in.setDuration( 5000 );
: am_in.setRepeatCount( -1 );
: img2.setAnimation(am_in);
: am_in.startNow();
: 上述程式碼可以成功無縫式播放,但是當完成一次播放後,
: 畫面會停頓,接續第二次播放。
: 因此,我應該如何改進將停頓的問題解決呢?
: ps:我有嘗試著
: //勻速動作
: LinearInterpolator lir = new LinearInterpolator();
: am_in.setInterpolator(lir);
: 但是還是沒有辦法克服此問題。
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 210.63.100.2
推
05/29 14:23, , 1F
05/29 14:23, 1F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):