ImageLoader工具类
来源:互联网 发布:cmd打开网络文件夹 编辑:程序博客网 时间:2024/06/05 08:01
public void setimage(String url, ImageView imageView, Context context) { ImageLoaderConfiguration loaderConfiguration = new ImageLoaderConfiguration.Builder(context).build(); DisplayImageOptions options = new DisplayImageOptions.Builder() .showImageOnLoading(R.mipmap.ic_launcher) //设置图片在下载期间显示的图片 .showImageForEmptyUri(R.mipmap.ic_launcher)//设置图片Uri为空或是错误的时候显示的图片 .showImageOnFail(R.mipmap.ic_launcher) //设置图片加载/解码过程中错误时候显示的图片 .cacheInMemory(true)//设置下载的图片是否缓存在内存中 .cacheOnDisk(true)//设置下载的图片是否缓存在SD卡中 .imageScaleType(ImageScaleType.IN_SAMPLE_INT)//设置图片以如何的编码方式显示 .bitmapConfig(Bitmap.Config.RGB_565)//设置图片的解码类型 .build();//构建完成 ImageLoader.getInstance().init(loaderConfiguration); ImageLoader.getInstance().displayImage(url, imageView, options);}
在此之前一定要先导包并且包的版本要为1.9.5版本
阅读全文
1 0
- ImageLoader工具类
- ImageLoader工具类
- ImageLoader工具类
- ImageLoader工具类封装
- ImageLoader工具类
- ImageLoader工具类
- ImageLoader工具类
- imageloader工具类
- Imageloader工具类
- ImageLoader的工具类
- ImageLoader工具类
- ImageLoader的工具类
- ImageLoader工具类
- ImageLoader的一个工具类
- ImageLoader的加载工具类
- ImageLoader加载图片工具类
- 文章标题 ImageLoader工具类
- ImageLoader加载图片工具类
- 如何调用百度编辑器ueditor的上传图片、上传文件等模块
- LeetCode——561. Array Partition I(贪心,C++)
- 熄灯问题(枚举、位运算)
- 自动代理的两种实现
- IDEA包分层显示
- ImageLoader工具类
- 通信测试中的仪表自动化
- ASP.NET WebForm Identity使用
- 图片转web字体库,如何制作web字体库
- 欧拉函数
- Android UI 自动化测试之运行命令及快速调试(二)
- prototype的类定义与继承
- Codeforces Round #427 (Div.2) B
- 数学方程总结