imageloard的网络加载图片的详解
来源:互联网 发布:亨通大数据产业园 编辑:程序博客网 时间:2024/06/05 11:03
String path = Environment.getExternalStorageDirectory() + "/aaaa";File pathFile = new File(path);ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(this) //指明内存缓存多少像素图片 480*800 .memoryCacheExtraOptions(480,800) //指明线程的优先级 .threadPriority(100) //配置多少个线程在后台加载图片 .threadPoolSize(3) //指明图片sdcard缓存,缓存到什么地方 .diskCache(new UnlimitedDiskCache(pathFile)) //限定一下缓存的大小 在内存当中缓存2MB的大小图片 .memoryCacheSize(2*1024*1024) //在sdcard缓存多少MB的图片 .diskCacheSize(50*1024*1024) //指明图片文件名(MD5) 为了避免有重复的图片 .diskCacheFileNameGenerator(new Md5FileNameGenerator()) .build(); ImageLoader.getInstance().init(config);
}
public static DisplayImageOptions getOption(){
DisplayImageOptions options = new DisplayImageOptions.Builder()
//正在加载时显示
.showImageOnLoading(R.mipmap.ic_launcher)
//加载为空时显示
.showImageForEmptyUri(R.mipmap.ic_launcher)
//正在加载时显示
.showImageOnFail(R.mipmap.ic_launcher)
//圆角图片
.displayer(new RoundedBitmapDisplayer(360))
.build();
return options;
}
阅读全文
0 0
- imageloard的网络加载图片的详解
- 详解ListView加载网络图片的优化
- ios网络图片的加载
- 加载网络图片的方法
- 实现网络图片的加载
- Gradview加载网络图片详解
- Android中网络图片的异步加载
- 关于异步加载网络图片的方法
- Android异步网络加载图片的控件
- 网络加载图片的三种方法
- IOS 加载网络图片的方式对比
- ListView加载网络图片的优化
- tableViewCell的网络图片加载方法
- ionic加载网络图片资源的解决方法
- Android----ListView的使用--->加载网络图片
- Picasso网络图片加载框架的使用
- 使用Picasso进行网络图片的加载
- 使用Picasso进行网络图片的加载
- Converting FC layers to CONV layers
- LeetCode--word ladder(python)
- C语言基础之位运算
- python操作excel
- Django连接数据库,解决Django migrate No changes detected 不能创建表的问题
- imageloard的网络加载图片的详解
- SynchronousQueue的使用
- 83. Remove Duplicates from Sorted List
- ConcurrentHashMap源码剖析(1.8版本)
- 自我介绍
- MyBatis中如何使用PageHelper插件实现 分页
- 好玩的东西
- 人工智能A7论坛2017年迄今最新人工智能资源盘点
- 写给in4sec的粉丝和志同道合的小伙伴们