Bonjour
Je chercher définir une "layout" qui m'affiche deux boutons, de meme dimension et que chacun mesure 50% de large.
Comment faire ?
Peut on définir une largeur en pourcentage ?
Merci d'avance pour vos réponse
Bonjour
Je chercher définir une "layout" qui m'affiche deux boutons, de meme dimension et que chacun mesure 50% de large.
Comment faire ?
Peut on définir une largeur en pourcentage ?
Merci d'avance pour vos réponse
Bonjour,
Essaye ce code :
Cordialement,
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
17
18
19 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout android:layout_width="fill_parent" android:background="#FFFFFF" android:layout_height="wrap_content" android:orientation="horizontal"> <Button android:text="@+id/Button01" android:id="@+id/Button01" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_weight="1"></Button> <Button android:text="@+id/Button02" android:id="@+id/Button02" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_weight="1"></Button> </LinearLayout> </LinearLayout>
Merci c'est ce que je voulais.
Je ne connaissait pas l'attribut : android:layout_weight="1"
Merci beaucoup !!!
Partager