2011-04-30 77 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。

相关问题