fresco加载本地图片


根据官方文档的说明,所有的url都必须是绝对路径:


类型 Scheme 示例
远程图片 http://, https:// HttpURLConnection
本地文件 file:// FileInputStream
Content provider content:// ContentResolver
asset目录下的资源 asset:// AssetManager
res目录下的资源 res:// Resources.openRawResource


在res/drawable文件下放一个gif文件:hello.png


Fresco适用的绝对url应该是这样的:

"res://com.xxx.yy/"+R.drawable.hello.png

其中 R.raw.web_loading 是id,不是字符串。com.xxx.yy 是你的项目包名


而asset中资源的用法则是:  asset:///refresh.gif   


你可能感兴趣的:(安卓开发,图片加载)