一个只需要导入jar包就可以使用的开源控件,用法和ImageView类似
jar包下载地址 :http://pan.baidu.com/s/1i3GEj7R
效果
–
XML
<RelativeLayout 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"
>
<com.ant.liao.GifView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/gifview"
></com.ant.liao.GifView>
</RelativeLayout>
Activity
...
GifView mGifView = (GifView) findViewById(R.id.gifview);
mGifView.setGifImage(R.drawable.f);
// 设置显示的大小,拉伸或者压缩 长度单位:px
mGifView.setShowDimension(600, 600);
...