2011-04-30 73 views
3

我在這個XML文件有一個Error parsing XML: unbound prefix錯誤在這個XML:錯誤解析XML:綁定前綴

<?xml version="1.0" encoding="UTF-8"?> 
<LinearLayout> 
    <TextView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/sipLabel" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"/> 
    <ImageView android:src="@drawable/connected" android:layout_width="wrap_content" 
     android:layout_height="wrap_content" android:layout_weight="0.35" android:gravity="center"/> 
</LinearLayout> 

的錯誤是在<ImageView>。 可能是什麼問題?

非常感謝。

回答

5

你必須把空間聲明xmlns:android="http://schemas.android.com/apk/res/android"在佈局XML的根元素:

+0

優秀的答案。非常感謝你。 – androniennn 2011-04-30 14:07:00

2

你需要定義xmlns屬性中最頂端的元素,在這種情況下,標籤的LinearLayout。

相關問題