Android Organise Layouts into Sub Folders

前端 未结 4 831
无人及你
无人及你 2020-12-16 10:14

I have a fairly complex android app, the contents of the \'layout\' folder is becoming increasingly large. I\'ve tried to organise the individual layout xml files into sub f

4条回答
  •  臣服心动
    2020-12-16 10:50

    Now with Android Studio and Gradle, you can have multiple resource folders in your project. Allowing to organize not only your layout files but any kind of resources.

    It's not exactly a sub-folder, but may separte parts of your application.

    The configuration is like this:

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

    Check the documentation.

提交回复
热议问题