Can the Android layout folder contain subfolders?

前端 未结 20 2817
暗喜
暗喜 2020-11-22 03:10

Right now, I\'m storing every XML layout file inside the \'res/layout\' folder, so it is feasible and simple to manage small projects, but when there is a case of large and

20条回答
  •  迷失自我
    2020-11-22 03:52

    While all the proposals for multiple resource sets may work, the problem is that the current logic for the Android Studio Gradle plug-in will not update the resource files after they have changed for nested resource sets. The current implementation attempts to check the resource directories using startsWith(), so a directory structure that is nested (i.e. src/main/res/layout/layouts and src/main/res/layout/layouts_category2) will choose src/main/res/layout/layouts consistently and never actually update the changes. The end result is that you have to rebuild/clean the project each time.

    I submitted a patch at https://android-review.googlesource.com/#/c/157971/ to try to help resolve things.

提交回复
热议问题