Bonjour,
J'ai essayé d'imbriquer deux listes view,c'est a dire que chaque item de la liste view parente contient une list view fille.
Ce que j'arrive pas a trouver une solution, c'est que ma listView fille je veux que toutes ces données s'affichent et non avoir une scrollbar pour les consulter, puisque en logique méme si on dépasse la taille de l'écran les données seront consulter par la scrollbar de la listView mère qui englobe le tout .
je vous montre mes 3 fichier xml :
Stock.xml
item_stock.xml
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 <?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" android:orientation="vertical"> <!-- Ma liste view mère --> <ListView android:id="@+id/lvStock" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="15dip" android:dividerHeight="10dp" android:divider="@android:color/transparent" > </ListView> </LinearLayout>
puis l'item de la liste view fille rf.xml :
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128 <?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="wrap_content" android:background="@drawable/linearborder" android:orientation="vertical" android:layout_gravity="center" android:weightSum="1" > <TextView android:id="@+id/tvEspece" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center" android:textColor="#812900" android:textStyle="bold" android:background="@drawable/espece_background" /> <View android:layout_width="fill_parent" android:layout_height="0.5dip" android:background="#c3c3c3" android:padding="1dip"/> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:gravity="center" android:weightSum="1" > <TextView android:id="@+id/tvType" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="PF" android:textStyle="bold" android:layout_weight="0.4" android:paddingLeft="5dp" /> <TextView android:id="@+id/tvQtProd" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Qte Prod" android:textStyle="bold" android:layout_weight="0.2" /> <TextView android:id="@+id/tvQtLiv" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Qte Liv" android:layout_weight="0.2" android:textStyle="bold" /> <TextView android:id="@+id/tvStock" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Qte Disp" android:layout_weight="0.2" android:textStyle="bold" /> </LinearLayout> <View android:layout_width="match_parent" android:layout_height="0.5dip" android:background="#c3c3c3"/> <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:weightSum="1" android:layout_weight="1"> <!-- La liste iew fille --> <ListView android:id="@+id/lvRf" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="center" > </ListView> </LinearLayout> <View android:layout_width="match_parent" android:layout_height="0.5dip" android:background="#c3c3c3"/> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:weightSum="1" android:gravity="center" > <TextView android:id="@+id/tvTotal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Total" android:textStyle="bold" android:layout_weight="0.4" android:paddingLeft="5dip" /> <TextView android:id="@+id/tvTotQtProd" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="0.2" /> <TextView android:id="@+id/tvTotQtLiv" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Qte Liv" android:layout_weight="0.2" /> <TextView android:id="@+id/tvTotQteStock" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Qte Disp" android:layout_weight="0.2" /> </LinearLayout> </LinearLayout>
L'image correspondante :
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 <?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" android:orientation="horizontal" android:gravity="center" android:weightSum="1" > <TextView android:id="@+id/tvTypeValue" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="0.4" android:paddingLeft="5dip" /> <TextView android:id="@+id/tvQtProdValue" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="0.2" /> <TextView android:id="@+id/tvQtLivValue" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_weight="0.2" /> <TextView android:id="@+id/tvStockValue" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="0.2" /> </LinearLayout>
Les rectangle que j’ai mis en rouge (avec paint ) contiennent encore plus de données qui peuvent être afficher via une scroollbar que j’essaye de l’enlever et aussi de voir tout les données .
Partager