使用虚拟文件夹组织布局文件
我正在开发一个涉及大量 XML 布局文件的 Android 应用程序。由于 Android 工具不允许布局目录中存在子目录,因此我尝试使用 Eclipse 的虚拟文件夹来组织我的项目(我使用的是 Eclipse 3.7)。本质上,我试图获得类似于 Xcode 的“组”的功能。
我可以创建虚拟文件夹,但是当我尝试向其中添加文件时,会收到消息“只能在虚拟文件夹下创建虚拟文件夹和链接”。我不太确定这意味着什么。有办法实现我想做的事情吗?谢谢!
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 sure what this means. Is there a way to achieve what I'm trying to do? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不可以。您不能这样做,因为布局 XML 文件需要存在于磁盘上的真实文件夹中,而虚拟文件夹基本上是搜索索引列表。
不幸的是,您将无法执行您想要的操作:虚拟文件夹不能用于存储 Android XML 文件,并且 Eclipse 调用来转换 Android XML 文件的
aapt
工具需要特定的文件夹结构,你不能偏离。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.根据 eclipse 的定义:
所以这意味着你不能在其中放置文件,并且 android 不允许为布局结构创建文件夹。
by definition from eclipse:
so this means you cannot place files in them, and android doesn't allow creating folders for the layout structure.