Bonjour à tous,
Je veut faire une calculatrice.
J'ai un problème avec les layout. Alors tout d'abord voila mon main.xml
Et voici ce qu'il donne
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 <?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:stretchColumns="0,1,2,3" android:background="@drawable/bg"> <TableRow> <EditText android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_span="4"/> </TableRow> <TableRow> <Button android:text="7"/> <Button android:text="8"/> <Button android:text="9"/> <Button android:text="C"/> </TableRow> <TableRow> <Button android:text="4"/> <Button android:text="5"/> <Button android:text="6"/> <Button android:text="="/> </TableRow> <TableRow> <Button android:text="1"/> <Button android:text="2"/> <Button android:text="3"/> </TableRow> <TableRow> <Button android:text="0" android:layout_span="2"/> <Button android:text=","/> </TableRow> </TableLayout>
Donc la il y a une calculatrice. Il y a 2 cases vide en bas à droite. Je voudrai que le bouton = prennent leurs place de sorte à ce que ca deviennent
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 |---------------| | EditText | |---|---|---|---| | 7 | 8 | 9 | C | |---|---|---|---| | 4 | 5 | 6 | = | |---|---|---|---| | 1 | 2 | 3 | | |-------|---|---| | 0 | , | | |-------|---|---|
Mais je ne sais pas comment faire
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 |---------------| | EditText | |---|---|---|---| | 7 | 8 | 9 | C | |---|---|---|---| | 4 | 5 | 6 | | |---|---|---| | | 1 | 2 | 3 | = | |-------|---| | | 0 | , | | |-------|---|---|
Merci d'avance![]()
Partager