属性
<animated-selector>根元素额
<item>android:id,android:drawable,android:state_***=[true|false]
<transiton> 设置状态切换时的动画,帧动画或向量动画
例子
<animated-selector
xmlns:android="......">
<item android:id="@+id/checked" android:drawable="@drawable/rect0"
android:state_checked="true"/>
<item android:id ="@+id/unchecked" android:drawable="@drawable/rect1"
android:state_unchecked="false"/>
<transition android:fromId="@id/unchecked"
android:toId="@id/checked">
<animation-list>
<item android:duration="100" android:drawable="@drawable/rect45/>
......
</animation-list>
</transition>
</animated-selector>
<checkBox
android:background="@drawable/animstatedrawable"
/>