【问题标题】:Is it possible to create multiple directories for drawable in res?是否可以在 res 中为 drawable 创建多个目录?
【发布时间】:2017-04-13 00:26:16
【问题描述】:

所以我尝试通过右键单击 res 文件夹然后在 new--> Android 资源目录上创建新目录。然后我将资源类型更改为可绘制。

完成所有操作后,我将图像复制到我创建的这个新目录中,当我尝试使用命令 android:src="@mydir/ 将它们分配给尚未通过 xml 分配图像的图像视图时mypic" android studio 无法识别我的自定义文件夹名称。这甚至可能吗?
我正在使用 android studio 2.2.3

【问题讨论】:

    标签: android android-studio android-studio-2.2.3


    【解决方案1】:

    您不能在 res/drawable 文件夹中为可绘制对象创建子文件夹。 请在 SO 中查看此问题。

    Can the Android drawable directory contain subdirectories?

    【讨论】:

      【解决方案2】:

      @Aris 我认为可以使用 gradle 创建多个目录,

      我在媒体上阅读了有关 Android 项目结构 - 替代方式的信息

      请检查此链接,

      https://medium.com/google-developer-experts/android-project-structure-alternative-way-29ce766682f0

      请仔细阅读结论。

      谢谢

      【讨论】:

        猜你喜欢
        • 2019-12-11
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2010-11-06
        • 1970-01-01
        • 2023-04-09
        • 2014-01-14
        • 1970-01-01
        相关资源
        最近更新 更多