安卓:什么时候适合于图像存储在资产,而不是可绘制文件夹? [英] Android: When is it appropriate to store images in the assets rather than the drawable folders?

查看:118
本文介绍了安卓:什么时候适合于图像存储在资产,而不是可绘制文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一堆是常见的所有决议案(目前我只支持一项决议。有原因的)。

图片

我的问题是,什么时候适合存储在资产images文件夹,而不是绘制文件夹?


解决方案

  

在res / raw目录的原始资源和资产之间的区别是资产表现得像一个文件系统,它们的可以上市,迭代,发现,就像文件而生资源,你需要的资源ID。


  
  

来源: http://mylifewithandroid.blogspot.it/2009/06/assets。 HTML (重点煤矿)


另外你可以当你需要使用子文件夹来整理东西使用的资产。

I have a bunch of images that are common for all resolutions (currently I only support one resolution. There are reasons for this).

My question is, when is it appropriate to store images in the assets folder rather than the drawable folder?

解决方案

The difference between a raw resource in res/raw directory and an asset is that assets behave like a file system, they can be listed, iterated over, discovered, just like files while for raw resources, you need the resource ID.

From: http://mylifewithandroid.blogspot.it/2009/06/assets.html (emphasis mine)

Also you may use assets when you need to organize things using sub-folders.

这篇关于安卓:什么时候适合于图像存储在资产,而不是可绘制文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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