長い時間が経過し、おそらく問題を修正しましたが、AnimationDrawableのsetEnterFaceDuration()を取得しました。例:あなたは1..N画像を通じて簡単にサイクリングを持って、このコードで
mBackgroundAnimation = new AnimationDrawable();
mBackgroundAnimation.addFrame(getResources().getDrawable(R.drawable.background1), 5000);
// ... rest of the frames
mBackgroundAnimation.addFrame(getResources().getDrawable(R.drawable.background6), 5000);
mBackgroundAnimation.setEnterFadeDuration(1000);
mBackgroundAnimation.setOneShot(false);
、それぞれがフェードインアニメーションで5秒(5000ms)のまま。さて、私は
mLayoutRoot.setBackground(mBackgroundAnimation);
mLayoutRoot.post(new AnimationStarterThread());
そしてAnimationStarterThreadクラス
private class AnimationStarterThread implements Runnable {
public void run() {
if(mBackgroundAnimation != null)
mBackgroundAnimation.start();
}
}
RelativeLayout私の根の背景を設定している何をすべきかまあ私も私が:-)何をしたか覚えていません。しかし、あなたのソリューションはきれいそうですそれを答えにしましょう! – Redwarp
それは1つのループのためだけにする方法はありますか? – Andy
現在、ループの数を制限する方法はありません。それを追加することはできますが、私は(メモリから)オリジナルのTransitionDrawableクラスを使ってそれを達成できると思います。 –