UTILISATION DES < INCLUDES /> EN ANDROID
Bonjour!
S'il vous plait est-ce possible d'utiliser plusieurs fois pour une même vue le même Je m'explique :
J'ai un layout main.xml et un autre fichier choix.xml.
Est-ce que je peux faire un truc de ce genre?
choix.xml
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| <LinearLayout
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<RadioGroup
android:padding="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Oui"/>
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Non"/>
</RadioGroup>
<EditText
android:hint="Précisez"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout> |
et ce même xml je veux faire plusieurs comme ceci dans le main.xml
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| TextView
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="20sp"
android:gravity="center"
android:textColor="@color/colorPrimaryDark"
android:text="Question 1"/>
<include
layout="@layout/choix.xml" />
TextView
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="20sp"
android:gravity="center"
android:textColor="@color/colorPrimaryDark"
android:text="Question 2"/>
<include
layout="@layout/choix.xml" />
TextView
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="20sp"
android:gravity="center"
android:textColor="@color/colorPrimaryDark"
android:text="Question "/>
<include
layout="@layout/choix.xml" /> |
S'il vous plait si quelqu'un a une idée qu'il me dise si c'est possible.
Merci d'avance.