Ошибка в этом XML: анализ ошибок XML: Unbound Prefix
-
27-10-2019 - |
Вопрос
у меня есть 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" [...]
Другие советы
Вам необходимо определить атрибут XMLNS в самом верхнем элементе, в данном случае, тег LinearLayout.
Не связан с StackOverflow