【问题标题】:Folders in /res in android project [duplicate]android项目中/ res中的文件夹[重复]
【发布时间】:2012-12-19 07:43:46
【问题描述】:

可能重复:
Can The Android drawable directory contain subdirectories?

如何在eclipse中的android项目的文件夹中组织graphics/java/xml文件? 我的意思是 - 我应该(存储图形)在我的“drawable-mdpi”中创建文件夹还是作为一个单独的文件夹?

我尝试在可绘制文件夹中创建文件夹并通过以下方式调用文件:

@drawable/photo/fileName

还尝试在 /res 中创建单独的文件夹,并通过以下方式调用:

@photo/fileName

但没有成功。

【问题讨论】:

    标签: android eclipse


    【解决方案1】:

    我应该(存储图形)在我的“drawable-mdpi”中创建文件夹还是作为一个单独的文件夹?

    遗憾的是,您无法在/res 文件夹中创建自己的文件结构...您必须使用existing folder structure,如/res/drawable-mdpi 并使用R.drawable.xxx

    您可以在此处阅读有关此“错误”的信息:Android layout folder organization 或直接从主要 Android 程序员那里阅读简要说明:Can The Android drawable directory contain subdirectories?

    【讨论】:

      【解决方案2】:

      您不需要/不能使用单独的文件夹。只需放入每个可绘制文件夹并使用@drawable/filename 访问,无需扩展名

      【讨论】:

      • 所以没有办法组织它(除了字母排序文件)?在我看来这很荒谬。
      • 看起来确实很疯狂,但是,不,您不能将单独的文件夹添加到 res 文件夹:(
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-25
      • 2015-11-19
      相关资源
      最近更新 更多