Android Aircraft Wars (VI) adding animated GIF images

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.