GifView的使用

来源:互联网 发布:软件招标书 编辑:程序博客网 时间:2024/05/22 08:03

把一张gif图在android手机中播放需要几步
1.下载GifView.jar 放入项目中
2.在布局中按照包名写出布局

 <com.ant.liao.GifView        android:id="@+id/gif"        android:layout_height="wrap_content"        android:layout_width="wrap_content"        >    </com.ant.liao.GifView>

3.在代码中初始化控件,加载gif

    private GifView mGifView;    public static  final String gifUrl="http://undefined.cunite.cn/1.gif";    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.activity_gif);        mGifView=(GifView)findViewById(R.id.gif);        mGifView.setGifImage(R.drawable.aaa );    }

这个是本地加载gif的方法,感觉流畅度什么的都还好,其他gif的功能目前还木有涉及到,如果以后涉及到会补充

0 0
原创粉丝点击