我有一个 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>
.
可能是什么问题?
非常感谢。
最佳答案
您必须将命名空间声明 xmlns:android="http://schemas.android.com/apk/res/android"
放在布局 xml 的根元素中:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" [...]
关于android - 此 XML 中的错误 : Error parsing XML: unbound prefix,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5842237/