문제

I have an Error parsing XML: unbound prefix in this xml file:

<?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>

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top