Can the Android drawable directory contain subdirectories?

后端 未结 21 948
醉梦人生
醉梦人生 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:50

    In android studio with gradle you can have multiple source directors which will allow you to separate resources. For example:

    android {
        ....
        android.sourceSets {
            main.res.srcDirs = ['src/main/extraresdirnamed_sandwiches', 'src/main/res']
        }
        ....
    }
    

    However the names must not collide which means you will still need to have names such as sandwiches_tunaOnRye but you will be able to have a seperate section for all of your sandwiches.

    This allows you to store your resources in different structures (useful for auto generated content such as actionbargenerator)

提交回复
热议问题