Eclipse 无法将我的 color.xml 识别为 android 文件
我创建了 /res/values/colors.xml
并输入一些内容。但eclipse并不将其视为android文件,只是普通的.xml。当我编辑 /res/valuse/strings.xml
时,它会在左下角显示一个 “资源”
视图。但当我编辑colors.xml时它是“Design”
。当我的光标放在元素上时,日食会用难看的颜色突出显示我的元素。
在Eclipse中将其制作为Android xml文件的方法是什么?
My created the /res/values/colors.xml
and type some content. But eclipse doesn't treat it as an android file, just normal .xml. When I edit my /res/valuse/strings.xml
, it shows a "Resources"
view at left down corner. But it's "Design"
when I edit colors.xml. And eclipse highlights my elements with a ugly color when my cursor on them.
What's the way to make it as Android xml file in Eclipse?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
是的,我仅在 Eclipse 上开发,它将在有条件的情况下工作
- 该文件应该位于 value 文件夹中
- 给出颜色值的标签应位于资源标签
#00ff00
或您选择的具有颜色 RGB 值的任何其他颜色中。
yes i m developing on eclipse only,it will work with condition
-the file should be in value folder
-the tag in which color value is given should be in resources tag
#00ff00
or any other color of your choice with color RGB value.
该文件可能未正确创建。先试试@steve 所说的;但是,如果这不起作用(并供将来参考),请在 Eclipse 中点击“新文件”选项时选择“Android xml 文件”来创建文件。它可能列在“其他”下。这不仅会以正确的格式设置文件,而且它有一个菜单,允许您指定这将是什么类型的 xml(即绝对布局、资源等...),并且可以生成一些样板 xml根据您的选择为您服务。
The file probably wasn't created properly. Try what @steve said first; however if that doesn't do it (and for future reference) create the file by choosing 'Android xml file' when you hit the 'new file' option in eclipse. It may be listed under 'other'. This will not only set up the file in the correct format, but it has a menu that allows you to specify what type of xml this will be (ie, absolute layout, resource etc...) and can generate some of the boilerplate xml for you based on your choices.
你是否用资源标签封装了颜色名称?,即:
Have you encapsulated the color names with the resources tag?, ie: