0

Display Animated GIF

I was reading that link above and some others butI can't get mine to work. I wither wanted it to run just the gif image in a view or something like that or have it split into frames and it goes threw each frame. Is there a video or something on this or can someone post there xml, and java file and the pictures they used. I need a really detailed tuturial for this one.

Also is it possible to send users messages on here?


This is the java class (FrenchSilk)

import android.app.Activity;
import android.os.Bundle;
import android.view.SurfaceView;

public class FrenchSilk extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.frenchsilk);

        SurfaceView v = (SurfaceView) findViewById(R.id.surfaceView1);
        GifRun w = new GifRun();
        w.LoadGiff(v, this, R.drawable.rotating_planet);

    }
}

This is the XML class (frenchsilk)

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:ignore="HardcodedText" >

<!--    <TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:gravity="center"
    android:text="Words"
    android:textSize="25dp" />  
-->


<SurfaceView
    android:id="@+id/surfaceView1"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />


</LinearLayout>

I have a gif file in the Drawable-hdpi folder called rotating_planet

I was following that youtube video but I don't no whats supposed to be in the GifRun class or if theres a different way to show a animated gif.

4

1 回答 1

-1

从这里下载 GifRun .....

https://www.dropbox.com/s/hij2gztuitz2lbn/TheGif.zip

于 2013-06-14T00:11:18.857 回答