Bonjour,
Je viens de rencontrer un problème sur une application que je suis entrain de créer. Pour des raisons pratiques, j'ai mis en background un relativeLayout, pour qu'il s'adapte en fonction de la taille de la fenêtre, mais cela ne fonctionne pas, car j'ai l'erreur suivante :
Voici mon main.xml :"android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>"
Et mon background.xml :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@layout/background" > </LinearLayout>
Une idée de l'erreur ? J'ai cherché sur de nombreux forums anglais, dont certains décrivaient l'erreur comme étant un problème de chargement, sans en expliquer explicitement la solution.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout android:id="@+id/relativeLayout1" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"> <ImageView android:src="@drawable/background_bottom" android:layout_height="wrap_content" android:id="@+id/background_bottom" android:layout_alignParentBottom="true" android:layout_width="fill_parent"> </ImageView> </RelativeLayout>
Partager