如何使用通用映像加载器加载资源在本地 [英] How to use Universal image Loader for loading resources locally

查看:108
本文介绍了如何使用通用映像加载器加载资源在本地的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道我如何使用 nostra13 / Android的通用映像,装载机的显示图像局部地从抽拉夹即随着的MemoryCache。我想用它与ViewPager。 任何帮助将大大AP preciated。

I want to know how can i use nostra13 / Android-Universal-Image-Loader for displaying Images locally i.e from drawable folder along with the Memorycache. I want to use it with ViewPager. any help will be greatly appreciated.

推荐答案

要加载的资产,图像和可绘你应该采取 ExtendedImageDownloader 从实例项目(这个类是不是库的一部分还),并同时将其设置为配置。

To load images from assets and drawables you should take ExtendedImageDownloader from example project (this class is not a part of library yet) and also set it to configuration.

UPD:加载本地资源(从绘制,资产,内容提供商)的作品开箱,因为 UIL v1.8.0

UPD: Loading local resources (from drawable, assets, content provider) works out of the box since UIL v1.8.0.

请参阅<一href="https://github.com/nostra13/Android-Universal-Image-Loader/blob/master/README.md"><$c$c>README:

String imageUri = "assets://image.png"; // from assets
String imageUri = "drawable://" + R.drawable.image; // from drawables (only images, non-9patch)

注:使用绘制:// 只有当你真的需要它!始终考虑到加载可绘制原生的方式 - 而不是使用 ImageLoader的 ImageView.setImageResource(...)

NOTE: Use drawable:// only if you really need it! Always consider the native way to load drawables — ImageView.setImageResource(...) instead of using of ImageLoader.

这篇关于如何使用通用映像加载器加载资源在本地的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆