简体   繁体   English

Eclipse XML编辑器显示android1不是android并且没有自动完成

[英]Eclipse XML editor shows android1 not android and no auto-complete

I'm using eclipse for Android programming, Today when i open to resume my app development the xml editor did't know the android tag at all like android:layout_...., It's knows android1 and the auto complete not working and says "Element is unknown"! 我正在使用eclipse进行Android编程,今天当我打开以恢复我的应用程序开发时,xml编辑器根本不知道android标签,例如android:layout _....,它知道android1和自动完成功能不起作用,并说“元素未知”!

Here's an example : 这是一个例子:

<TextView
    android1:id="@+id/textView1"
    android1:layout_width="wrap_content"
    android1:layout_height="wrap_content"
    android1:layout_alignRight="@+id/help"
    android1:textSize="20dp" />

Any ideas to solve it ? 有什么办法解决吗?

It looks like you may have messed up your namespaces. 看来您可能弄乱了名称空间。 So in your XML layout files, replace all xmlns: tags with: 因此,在XML布局文件中,将所有xmlns:标记替换为:

xmlns:android="http://schemas.android.com/apk/res/android

This should be in your top-level element, and it should look something like this: 这应该在您的顶级元素中,并且看起来应该像这样:

<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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM