2011-08-25 68 views
0

正如我們所知,逐幀動畫是由多個圖像構成的,並且圖像來自可繪製文件夾。 像這樣:圖像逐幀動畫來自URL

<animation-list xmlns:android= 
    "http://schemas.android.com/apk/res/android" 
android:oneshot="false"> 
    <item android:drawable="@drawable/renew20001" android:duration="50" /> 
    <item android:drawable="@drawable/renew20002" android:duration="50" /> 
    <item android:drawable="@drawable/renew20003" android:duration="50" /> 
    <item android:drawable="@drawable/renew20004" android:duration="50" /> 
    <item android:drawable="@drawable/renew20005" android:duration="50" /> 
</animation-list> 

現在我得到來自特定url.and顯示圖像animation.is可以不?如果是,則提供解決方案。

回答

0

我不確定你將能夠從其他地方加載圖像比可繪文件夾 這裏是我熟化的版本。

private static final int DELAY = 500; 
Runnable changeImage = new Runnable() {  
    @Override 
    public void run() { 
     myImageView.setImageBitmap(getNewBitmap()); 
     myImageView.postDelayed(changeImage, DELAY); 
    } 
}; 

的onResume

myImageView.postDelayed(changeImage, DELAY);