有沒有辦法將xml
animation-list
設置爲xml
屬性?我可以設置和如下程序啓動它:如何將動畫列表設置爲xml屬性
ImageView img = (ImageView) findViewById(R.id.loadingImageView);
img.setBackgroundResource(R.drawable.loading_animation);
AnimationDrawable frameAnimation = (AnimationDrawable) img.getBackground();
frameAnimation.start();
動畫列表是:
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
//...
android:oneshot="false" >
<item
android:drawable="@drawable/loading_anim_frame_one"
android:duration="50"/>
<item
android:drawable="@drawable/loading_anim_frame_two"
android:duration="50"/>
等等。
有沒有辦法做到這一點與xml
標記只,即沒有Java代碼?
如果沒有,是否有辦法至少將其設置爲xml
屬性,然後以編程方式啓動它?
我不能使用單個drawable的旋轉,因爲動畫是由幾個drawable按順序組成的。
https://stackoverflow.com/questions/29603032/how-to-start-a-second-animation-list-有用的鏈接s = 0 | 2.9229 請幫我解決我的問題..我被卡住了很嚴重... – 2015-04-14 15:32:30