使用Glide以及OkHttp集成

一、glide的使用:git

添加依赖:github

 

  1. compile 'com.github.bumptech.glide:glide:3.7.0'  

调用代码:ide

 

 

  1. ImageView imageView = (ImageView) findViewById(R.id.my_image_view);  
  2.   
  3. Glide.with(this).load("http://goo.gl/gEgYUd").into(imageView);  

 

 

二、添加OKHttp3集成:this

 

  1. compile 'com.github.bumptech.glide:okhttp3-integration:1.4.0@aar'  
  2. compile 'com.squareup.okhttp3:okhttp:3.1.2'  

 

 

三、出现的问题.net

 

  1. You must not call setTag() on a view Glide is targeting   

 

解决方案:把seTag调用改成setTag(key,Object)调用:blog

 

  1. ImageView.setTag(R.id.ImagViewId,saveObject);  

 

 

参考:http://blog.csdn.NET/kyleceshen/article/details/49806267get

https://github.com/bumptech/glideit

相关文章
相关标签/搜索