Can the Android drawable directory contain subdirectories?

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

    Not mine but I found this thread when looking for this issue, if your using Android Studio and Gradle Build system its pretty easy no plugins necessary just a little build file editing

    https://stackoverflow.com/a/22426467/618419

    0 讨论(0)
  • 2020-11-22 04:54

    create a folder in main. like: 'res_notification_btn'

    and create tree folder in. like 'drawable' or 'layout'

    then in 'build.gradle' add this

    sourceSets
                {
                    main
                    {
                        res
                        {
                            srcDirs = ['src/main/res_notification_btn', 'src/main/res']
                          or
                            srcDir 'src/main/res_notification_btn'
                        }
                    }
                }
    
    0 讨论(0)
  • 2020-11-22 04:59

    I've wrote an eclipse plugin which allows to create virtual subfolder by separating the file name with two underscores __. The project is in early stages, but don't worry it won't crash your IDE

    more details can be found here, feel free to fork and send pull requests:

    https://github.com/kirill578/Android-Sorted-Res-Folder

    enter image description here

    0 讨论(0)
提交回复
热议问题