3

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>

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

非常感谢。

4

2 回答 2

5

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

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" [...]
于 2011-04-30T14:04:22.733 回答
2

您需要在最顶层元素中定义 xmlns 属性,在本例中为 LinearLayout 标记。

于 2011-04-30T14:07:26.943 回答