Fehler in diesem XML: Fehler Parsen XML: Ungebundenes Präfix
-
27-10-2019 - |
Frage
ich habe ein Error parsing XML: unbound prefix
In dieser XML -Datei:
<?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>
Der Fehler ist in <ImageView>
. Was könnte das Problem sein?
Vielen Dank.
Lösung
Sie müssen die Namespace -Deklaration einlegen xmlns:android="http://schemas.android.com/apk/res/android"
Im Stammelement Ihres Layouts XML:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" [...]
Andere Tipps
Sie müssen das XMLNS -Attribut im obersten Element definieren, in diesem Fall das Linearlayout -Tag.
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow