Can you add subfolder to layout in Eclipse Android project?

不羁岁月 提交于 2019-12-19 07:45:09

问题


When I create a subfolder in the layout folder, and drag an xml file to it, the generated R file doesn't seem to show the subfolder. a) is there a way to change that b) is the file and file structure still picked up by SVN and c) so, if I do it that way, can I still just refer to the object using layout?


回答1:


When I create a subfolder in the layout folder, and drag an xml file to it, the generated R file doesn't seem to show the subfolder

That is because that is not supported by Android. You cannot have subfolders of resources.

PHP_Jedi's advice, though, is good (e.g., svn:ignore).




回答2:


Its all automatic.

a )The generated R class only contains static integers for each item in your layout.

b) What is picked up by svn is all up to you, but I usally put the gen folder to svn:ignore

c) if you put the gen folder and the R.java into svn you could get problems since a old version of the file can be checked in/out of the respository. This will happen if you are part of a team. So, put svn:ignore on the gen folder.



来源:https://stackoverflow.com/questions/2547100/can-you-add-subfolder-to-layout-in-eclipse-android-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!