Android studio如何用GIF图作为背景

1、先将你需要的GIF进行压缩,不然有可能会内存溢出

2、将你的GIF放到drawable当中

3、引入GIF依赖

//引入GIF背景动态图实现依赖
compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.+'

4、添加自定义GIF控件

<pl.droidsonroids.gif.GifImageView

    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/lutos_background" /> 

5、完成

猜你喜欢

转载自blog.csdn.net/MrLi_IT/article/details/80859342
今日推荐