Can the Android drawable directory contain subdirectories?

后端 未结 21 1328
醉梦人生
醉梦人生 2020-11-22 04:13

In the Android SDK documentation, all of the examples used with the @drawable/my_image xml syntax directly address images that are stored in the res/drawable directory in my

21条回答
  •  星月不相逢
    2020-11-22 04:44

    No, the resources mechanism doesn't support subfolders in the drawable directory, so yes - you need to keep that hierarchy flat.

    The directory layout you showed would result in none of the images being available.

    From my own experiments it seems that 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.

提交回复
热议问题