开发者

Android layout folder organization

I am developing an Android app and I currently have about 8 layout xml files in the layout folder. The need for organizing this folder is increasing with each additional layout resource file. However, when I create a folder inside of the layout folder and move a resource to it via the refactor operation, it breaks my project.

For example, my resource i开发者_如何学Cs being refernced here:

setContentView(R.layout.login);

After moving the login.xml file to a newly created folder called "test", it breaks my build.

If I update the reference to:

setContentView(R.layout.test.login);

It still doesn't compile.

Any help would be greatly appreciated.


Sub folders in resources is not currently supported. I think everyone who read this should put a star on the issue.


you need to follow the naming convention You cannot create a folder inside a layout. if you want to create a folder, create inside a res folder. ex:- layout-large,layout-small etc

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜