转换可绘制对象中是否可以有超过2个项目?我需要更改背景,使第二帧淡入,然后第三帧在其上方淡出,以此类推到第四帧...
目前我有这个:
<?xml version="1.0" encoding="UTF-8"?>
<transition xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/voting_button_not1"/>
<item android:drawable="@drawable/voting_button_not2"/>
<item android:drawable="@drawable/voting_button_not3"/>
<item android:drawable="@drawable/voting_button_not4"/>
<item android:drawable="@drawable/voting_button_not5"/>
<item android:drawable="@drawable/voting_button_not1"/>
</transition>
我得到了按钮:
<ImageButton android:id="@+id/skipButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/coldf1f2"
android:scaleType="fitCenter"
android:adjustViewBounds="true"/>
顺便说一下,它是一个ImageButton并不重要。
在我的代码中,我得到了这样的东西:
TransitionDrawable vote_not = (TransitionDrawable)skip.getBackground();
vote_not.startTransition(1000);
它只播放第一项到第二项的过渡效果,但我需要整个列表都播放。