Why Android xml layout file doesn't recognize content assist by ctrl+space?

Amt*_*t87 8 xml eclipse layout android

I am facing problem with eclipse that is when I am using the Android xml layout file to design a screen, I try to add attribute to an element that I have already created. I used to type two letters of the attribute then tap ctrl+space so it will show list of all available attribute by IntelliSense. Now it is not showing anything, instead it is showing a message at the bottom of the screen like below image.

Anybody faced the problem and solved it?

Appreciate your help because it is slowing down my work.

在此输入图像描述

Kar*_*amy 3

答案更新:

就这样,

我猜您正在尝试访问Parameter Hints (Ctrl+Shift+Space)而不是 Default Content Assist (Ctrl+Space)

  1. 如果我们按(Ctrl+Shift+Space)java 文件,它将为您提供详细的参数描述以及特定的方法名称列表。

  2. 如果我们按(Ctrl+Shift+Space)xml 文件,则会出现以下错误,

    (a.) 元素或任何事物未知。

    (b.) 当前位置不提供内容辅助。

    (c.) 没有可用的完成。

旧答案:

根据Eclipse内容辅助文档,

错误Element Unknown是因为,

我们Element要找的 是没有定义的in-scope schema definitions

XML Content Assist将从schema文件和所属xml文件描述中加载。

所以基本上不会错过任何Elements机会android sdk

检查以下是否遗漏了什么preferences

窗口-首选项-XML-XML 文件-编辑器-内容辅助 勾选priorities重置它。

我想,你可能错过了某个地方,因为我注意到在你所附的图片中,

Graphical Layout.xml是您的布局名称。它不能这样命名,在 中android,它应该没有任何空格,并且应该“以小写开头”

如果您提供详细的*错误报告*,那么有人就有可能解决它。

您提到,对于所有文件layout,您都会遇到相同的错误,因此您可以创建一个简单的示例布局并粘贴您的问题。

所以我的建议是,请通过定义和提供打开优先级来检查 xml 文件中的某个地方是否出错。

并检查“窗口首选项”XML Content Assist菜单中的。

  • 感谢您的详细回答。实际上我使用了以下内容:在内容辅助页面中,我将建议策略从严格更改为宽松,然后它就起作用了。我不知道这是否是重点。根据 xml 文件命名,我只是在绘制上更改了它:) (2认同)