Android 将布局组织到子文件夹中 [英] Android Organise Layouts into Sub Folders
问题描述
我有一个相当复杂的 android 应用程序,'layout' 文件夹的内容变得越来越大.我试图将各个布局 xml 文件组织到子文件夹中,例如layout/buttons/、layout/activity/、layout/views/等.这似乎不起作用,文件夹的内容未解析为 R. 类.
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 folders e.g. layout/buttons/, layout/activity/, layout/views/ etc. This doesn't seem to work, the content of the folders in not parsed into the R. class.
有没有办法做到这一点?
Is there a way to do this?
谢谢!
推荐答案
我认为您无法做到这一点.我相信它只支持某些文件夹名称,例如 layout-large,layout-mdpi、layout-hdpi、layout-fr 等.您可以使用多个这些修改以及 layout-fr-hdpi-large.
I don't think you're going to be able to do this. I believe that it only supports certain folder names like layout-large, layout-mdpi, layout-hdpi, layout-fr, etc. You can use more than one of these modifies as well like layout-fr-hdpi-large.
此页面显示所有允许的修饰符
This page shows all of the allowed modifiers
http://developer.android.com/guide/topics/资源/providing-resources.html
这篇关于Android 将布局组织到子文件夹中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!