[英]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.