GitHub:https://github.com/bumptech/glide
添加依赖
repositories {
mavenCentral() // jcenter() works as well because it pulls from Maven Central
}
dependencies {
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.android.support:support-v4:19.1.0'
}
使用方法很简单
Glide.with(this)
.load("http://imgsrc.baidu.com/forum/pic/item/0cb0e4039245d6887c41b02fadc27d1ed31b2443.jpg")//加载网址
.placeholder(R.mipmap.ic_launcher)//加载图片
.error(R.mipmap.ic_launcher)//加载错误图片
.into(imageview);//加载控件
这也可以直接加载GIF图