使用虚拟文件夹组织布局文件

发布于 2024-11-18 13:09:48 字数 235 浏览 4 评论 0原文

我正在开发一个涉及大量 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

雨夜星沙 2024-11-25 13:09:48

不可以。您不能这样做,因为布局 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.

撩发小公举 2024-11-25 13:09:48

根据 eclipse 的定义:

<块引用>

虚拟文件夹是仅存在于 Eclipse 工作区中的文件夹
树,并且没有文件系统
位置。

通过使用虚拟文件夹、文件和
可以在项目中组织文件夹
独立于文件的层次结构
这些资源的系统位置。

常规文件和文件夹资源可以
不能在虚拟文件夹下创建,
因为他们需要文件系统位置
作为他们的父母为了存在
文件系统。仅限其他虚拟
文件夹或链接资源可以是
直接在虚拟下创建
文件夹。

所以这意味着你不能在其中放置文件,并且 android 不允许为布局结构创建文件夹。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文