2011-08-25 69 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);