Error in this XML: Error parsing XML: unbound prefix
I have an Error parsing XML: unbound prefix
in this xml file:
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout>
<Text开发者_StackOverflow中文版View 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>
The error is in <ImageView>
.
What could be the problem?
Thank you very much.
You must put the namespace declaration xmlns:android="http://schemas.android.com/apk/res/android"
in the root element of your layout xml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" [...]
Your need to define the xmlns attribute in the topmost element, in this case, the LinearLayout tag.
精彩评论