Organizing layout files using virtual folders
I'm working on a Android application that involves a lot of XML layout files. Since the Android tools don't allow subdirectories in the layout directory, I am trying to organize my project using Eclipse's virtual folders (I'm using Eclipse 3.7). Essentially, I'm trying to get functionality similar to Xcode's "groups".
I'm able to create virtual folders, but when I try to add files to them I am given the message "Only virtual folders and links can be created under a virtual folder." I'm not really 开发者_JS百科sure what this means. Is there a way to achieve what I'm trying to do? Thanks!
No. You can't do that because the layout XML files are required to exist in a real folder on disk, and the virtual folders are basically search index listings.
Unfortunately you won't be able to do what you want: virtual folders can not be used to store Android XML files, and the aapt
tool that Eclipse invokes to convert Android XML files expects a specific folder structure which you can't deviate from.
by definition from eclipse:
Virtual folders are folders that exist only in the Eclipse workspace tree, and have no file system location.
By using virtual folders, file and folders can be organized in a project hierarchy independently of the file system location of those resources.
Regular file and folder resources can not be created under a virtual folder, since they need a file system location as their parent in order to exist in the file system. Only other virtual folders, or linked resources can be created directly under a virtual folder.
so this means you cannot place files in them, and android doesn't allow creating folders for the layout structure.
精彩评论