There are two ways
The first kind of trouble is that you need to decompose a GIF into a frame and then draw the frame one by one, which is troublesome.
Second, you can download a drawable.gif package directly on the Internet
The following files are available under the Libs folder in the package
650) this.width=650; "style=" float:left; "src=" http://s3.51cto.com/wyfs02/M00/71/6F/ Wkiol1xqz8ngiwkmaacddwhxofa026.jpg "title=" Z$d8fi{m6w@vgz8jj[a305p.png "alt=" Wkiol1xqz8ngiwkmaacddwhxofa026.jpg " />
Copy all of these files to the Libs folder of your Android program (there are two useless, but it doesn't matter, all copied into the line), so that the GIF package is complete, then you can add GIF pictures!!
Create a new layout
<?xml version= "1.0" encoding= "Utf-8"?>
<linearlayout xmlns:android= "Http://schemas.android.com/apk/res/android"
Android:layout_width= "Match_parent"
android:layout_height= "Match_parent"
android:orientation= "Vertical" >
<pl.droidsonroids.gif.gifimageview
Android:layout_width= "Fill_parent"
android:layout_height= "Fill_parent"
android:background= "@drawable/gif"
/>
</LinearLayout>
And then in the mainactivity.
public class Begin_gif extends Activity {
protected void OnCreate (Bundle savedinstancestate) {
Super.oncreate (savedinstancestate);
Setcontentview (r.layout.begin_gif);
}
}
This will allow you to play your GIF pictures!!!
GIF package in the attachment, you can also search from the Internet, and then download
This article is from the "Software Learning Summary" blog, be sure to keep this source http://bigcrab.blog.51cto.com/10626858/1685038
Android Aircraft Wars (VI) adding animated GIF images