[英]Eclipse XML editor shows android1 not android and no auto-complete
我正在使用eclipse进行Android编程,今天当我打开以恢复我的应用程序开发时,xml编辑器根本不知道android标签,例如android:layout _....,它知道android1和自动完成功能不起作用,并说“元素未知”!
这是一个例子:
<TextView
android1:id="@+id/textView1"
android1:layout_width="wrap_content"
android1:layout_height="wrap_content"
android1:layout_alignRight="@+id/help"
android1:textSize="20dp" />
有什么办法解决吗?
看来您可能弄乱了名称空间。 因此,在XML布局文件中,将所有xmlns:
标记替换为:
xmlns:android="http://schemas.android.com/apk/res/android
这应该在您的顶级元素中,并且看起来应该像这样:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="@+id/help"
android:textSize="20dp" />
</RelativeLayout>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.