是否有可能使用子文件夹在Android中可绘制? [英] Is it possible to use sub folders in drawables in Android?

查看:146
本文介绍了是否有可能使用子文件夹在Android中可绘制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用我有几个文件夹和图像的子文件夹。他们都在里面可绘制。如何从可绘子文件夹检索图像?

In my application I have several folders and subfolders of images. They are inside drawables. How can I retrieve images from drawables subfolders?

例如:

绘制>行动>体育> soccer.png

drawable>actions>sports>soccer.png

我如何能得到这个soccer.png照片么?

How can I get this "soccer.png" photo?

任何帮助是AP preciated。

Any help is appreciated.

谢谢!

推荐答案

,Android的资源机制不支持子文件夹中的绘制目录,你不能把它。

No, the android resources mechanism doesn't support subfolders in the drawable directory, you can't put it.

我觉得如果你有在任何项目的子文件夹,在 RES /绘制文件夹中,会造成资源编译器失败 - preventing的 R.java 无法正确生成的文件。

I think if you having a subfolder with any items in it, within the res/drawable folder, will cause the resource compiler to fail -- preventing the R.java file from being generated correctly.

唯一一件事就是把图像平坦的名字一样, drawable_actions_sports_soccer.png

The only one thing is put the images in flat names like, drawable_actions_sports_soccer.png.

这篇关于是否有可能使用子文件夹在Android中可绘制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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