在android中使用Gif文件 [英] use Gif file in android

查看:229
本文介绍了在android中使用Gif文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我在我的Android应用程序中使用了ImageView的gif图像,但图片没有任何动作。

Hi I'm using gif image by ImageView in my android application, But the picture doesn't have any movement.

<ImageView

android:id="@+id/imageView2"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_x="106dp"

android:layout_y="340dp"

android:src="@drawable/clappinghands" />

推荐答案

更好的解决方案是使用 VideoView 。如果你想使用ImageView,你需要划分图像,然后应用动画。参见:

添加-gif-image-in-an-imageview-in-android [ ^ ]

Playing-an-animated-gif-image-file-in-imageview [ ^ ]
Better solution you should use a VideoView. If you want to use ImageView then you need to divide the image and then apply animation.See:
Adding-gif-image-in-an-imageview-in-android[^]
Playing-an-animated-gif-image-file-in-imageview[^]


这篇关于在android中使用Gif文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆