在项目中使用gif作为jpg

时间:2013-08-30 23:23:22

标签: android eclipse jpeg gif

我可以在eclipse中声明像jpg一样的gif吗?

<ImageView
    android:contentDescription="@string/ppant"
    android:id="@+id/gifYesOrNo"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_above="@+id/button4"
    android:layout_alignLeft="@+id/button4"
    android:layout_alignRight="@+id/button4"
    android:src="@drawable/gif" />

由于

1 个答案:

答案 0 :(得分:0)

你可以声明它,但它不会被动画化。如果你想要它,你可以使用webview(不是很好的解决方案)和VideoView。您可以在此处找到一些帮助:Display Animated GIF。如果你真的想要在ImageView中检查一下:Playing an animated GIF image file in imageview。无论你决定什么,你都可以在这里找到很多有用的东西:http://droid-blog.net/2011/10/14/tutorial-how-to-use-animated-gifs-in-android-part-1/。希望这会有所帮助。