简体   繁体   中英

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"!

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:

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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