Bonjour,
Je suis désolé j'ai encore une autre question
J'essaye de centrer verticalement une TableLayout dans un LinearLayout verticale mais rien n'y fait, je n'y arrive pas.
Pourtant j'ai tout essayé, layout_gravity / gravity / ne pas les mettre dans les rowTable mais juste dans le TableLayout etc ...
Voici le code xml =
D'autre part j'ai mis quelques View vide comme séparateur mais je ne sais pas si c'est une bonne méthode.
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
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79 <?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" > <TableLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:stretchColumns="1" > <TableRow android:layout_gravity="center_vertical" android:layout_height="wrap_content" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Identifiant :" /> <EditText android:id="@+id/pseudo" android:layout_width="fill_parent" android:layout_height="wrap_content" android:autoText="false" android:capitalize="none" android:singleLine="true" /> <CheckBox android:id="@+id/checkPref" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="s'en rappeler" android:textStyle="italic" android:textSize="8px" /> </TableRow> <TableRow android:layout_gravity="center_vertical" android:layout_height="wrap_content" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Mot de passe :" /> <EditText android:id="@+id/mdp" android:layout_width="fill_parent" android:layout_height="wrap_content" android:autoText="false" android:capitalize="none" android:singleLine="true" android:password="true" android:layout_span="2" /> </TableRow> <View android:layout_height="20px" /> <TableRow android:layout_gravity="center_vertical" android:layout_height="wrap_content" > <View/> <Button android:id="@+id/envoyer" android:layout_height="wrap_content" android:layout_width="fill_parent" android:text="Se connecter" android:onClick="connexion" /> </TableRow> </TableLayout> </LinearLayout>
Partager