Android的整理布局到子文件夹文件夹、布局、Android

2023-09-13 01:23:14 作者:龙啸

我有一个相当复杂的Andr​​oid应用程序,在布局文件夹中的内容变得越来越大。我一直在努力,个人的布局XML文件组织到子文件夹,例如:布局/按键/,布局/活动/,布局/视图/等,这似乎并没有工作,解析为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?

谢谢!

推荐答案

我不认为你将能够做到这一点。我相信,它仅支持像布局大型某个文件夹的名称, 布局MDPI,布局,华电国际,布局-FR,等等。你可以使用一个以上的这些修改,以及类似的布局-FR-HDPI-大。

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/resources/providing-resources.html