此XML中的错误:解析XML时出错:未绑定的前缀

and*_*nnn 3 android android-xml

Error parsing XML: unbound prefix在这个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>
Run Code Online (Sandbox Code Playgroud)

错误在于<ImageView>.可能是什么问题呢?

非常感谢你.

rek*_*eru 5

您必须将名称空间声明xmlns:android="http://schemas.android.com/apk/res/android"放在布局xml的根元素中:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" [...]
Run Code Online (Sandbox Code Playgroud)