Bonjour,

je voudrai utiliser un scrollview avec des boutons et des imageview mais j'ai des problèmes de mauvais placement des widgets, ils ont tous des

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
 
tools:layout_editor_absoluteX="36dp"
tools:layout_editor_absoluteY="1181dp"
je sais que ce n'est visible dans l'éditeur, j'ai donc ajouté :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
 
            app:layout_constraintTop_toBottomOf="@+id/button8"
            android:layout_marginTop="110dp"
            android:layout_marginLeft="35dp"
mes boutons sont maintenant bien placés, mais les imageview, pas moyen ....enfin les id 1 et 2 ok , les autres ne bougent pas !!!

voici mon fichier layout :

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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
 
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
 
    android:layout_width="match_parent"
    android:layout_height="fill_parent"
    android:layout_weight = "1"
    android:orientation="vertical"
    android:padding="10dp"
    android:background="@drawable/r1"
    android:fillViewport="true">
 
 
    <android.support.constraint.ConstraintLayout
        android:id="@+id/scroll1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:layout_editor_absoluteX="10dp"
        tools:layout_editor_absoluteY="9dp">
 
 
        <TextView
            android:id="@+id/textView2"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="16dp"
            android:layout_weight="0.04"
 
            android:text="Les Poissons Blancs"
            android:textAlignment="viewStart"
            android:textColor="@android:color/holo_green_light"
            android:textSize="36sp"
            android:textStyle="bold"
            app:layout_constraintTop_toTopOf="@+id/button1"
            android:layout_marginTop="1000dp">
 
        </TextView>
 
 
        <Button
            android:id="@+id/button4"
            style="@android:style/Widget.Holo.Light.Button"
            android:layout_width="120dp"
            android:layout_height="48dp"
            android:text="Ablette"
            app:layout_constraintTop_toBottomOf="@+id/textView2"
            android:layout_marginTop="150dp"
            android:layout_marginLeft="35dp"
            app:layout_constraintLeft_toLeftOf="parent" />
 
 
        <Button
            android:id="@+id/button5"
            style="@android:style/Widget.Holo.Light.Button"
            android:layout_width="120dp"
            android:layout_height="47dp"
            android:text="Barbeau"
            app:layout_constraintTop_toBottomOf="@+id/button4"
            android:layout_marginLeft="35dp"
            app:layout_constraintLeft_toLeftOf="parent"
            android:layout_marginTop="110dp" />
 
        <Button
            android:id="@+id/button6"
            style="@android:style/Widget.Holo.Light.Button"
            android:layout_width="120dp"
            android:layout_height="48dp"
            android:text="Brème"
            app:layout_constraintTop_toBottomOf="@+id/button5"
 
            android:layout_marginTop="110dp"
            android:layout_marginLeft="35dp"
            app:layout_constraintLeft_toLeftOf="parent" />
 
        <Button
            android:id="@+id/button7"
            style="@android:style/Widget.Holo.Light.Button"
            android:layout_width="120dp"
            android:layout_height="48dp"
            android:text="Carpe"
            app:layout_constraintTop_toBottomOf="@+id/button6"
            android:layout_marginLeft="35dp"
            android:layout_marginTop="110dp"
            app:layout_constraintLeft_toLeftOf="parent" />
 
        <Button
            android:id="@+id/button8"
            style="@android:style/Widget.Holo.Light.Button"
            android:layout_width="120dp"
            android:layout_height="48dp"
            android:text="Carassin"
            app:layout_constraintTop_toBottomOf="@+id/button7"
            android:layout_marginLeft="35dp"
 
            android:layout_marginTop="110dp"
            app:layout_constraintLeft_toLeftOf="parent" />
 
        <Button
            android:id="@+id/button9"
            style="@android:style/Widget.Holo.Light.Button"
            android:layout_width="120dp"
            android:layout_height="48dp"
            android:text="Chevesne"
            app:layout_constraintTop_toBottomOf="@+id/button8"
            android:layout_marginTop="110dp"
            android:layout_marginLeft="35dp"
            app:layout_constraintLeft_toLeftOf="parent" />
 
        <Button
            android:id="@+id/button10"
            style="@android:style/Widget.Holo.Light.Button"
            android:layout_width="120dp"
            android:layout_height="48dp"
            android:layout_marginStart="16dp"
            android:text="Gardon"
            app:layout_constraintTop_toBottomOf="@+id/button9"
            android:layout_marginTop="110dp"
            android:layout_marginLeft="35dp"
            app:layout_constraintLeft_toLeftOf="parent" />
 
        <ImageView
            android:id="@+id/imageView1"
            android:layout_width="0dp"
            android:layout_height="48dp"
            android:layout_weight="0.00"
            app:srcCompat="@drawable/ablette"
            app:layout_constraintTop_toBottomOf="@+id/textView2"
            android:layout_marginTop="150dp"
            android:layout_marginLeft="440dp"
            app:layout_constraintLeft_toLeftOf="parent" />
 
        <ImageView
            android:id="@+id/imageView2"
            android:layout_width="92dp"
            android:layout_height="48dp"
            app:srcCompat="@drawable/barbeau"
            app:layout_constraintTop_toBottomOf="@+id/imageView1"
            android:layout_marginTop="110dp"
            android:layout_marginLeft="440dp"
            app:layout_constraintLeft_toLeftOf="parent" />
 
        <ImageView
            android:id="@+id/imageView3"
            android:layout_width="92dp"
            android:layout_height="48dp"
            android:layout_marginEnd="1dp"
            app:srcCompat="@drawable/breme"
            app:layout_constraintTop_toBottomOf="@+id/imageView2"
 
            app:layout_constraintLeft_toLeftOf="parent"
 
            android:layout_marginTop="110dp" />
 
        <ImageView
            android:id="@+id/imageView4"
            android:layout_width="92dp"
            android:layout_height="48dp"
            android:layout_marginEnd="8dp"
            app:srcCompat="@drawable/carpe"
            app:layout_constraintTop_toBottomOf="@+id/imageView3"
            android:layout_marginLeft="440dp"
            app:layout_constraintLeft_toLeftOf="parent"
            android:layout_marginTop="110dp" />
 
        <ImageView
            android:id="@+id/imageView5"
            android:layout_width="92dp"
            android:layout_height="48dp"
            android:layout_marginEnd="129dp"
            app:srcCompat="@drawable/carassin"
            app:layout_constraintTop_toBottomOf="@+id/imageView4"
            android:layout_marginLeft="440dp"
            app:layout_constraintLeft_toLeftOf="parent"
            android:layout_marginTop="110dp"
            />
 
        <ImageView
            android:id="@+id/imageView6"
            android:layout_width="92dp"
            android:layout_height="48dp"
            app:srcCompat="@drawable/chevesne"
            app:layout_constraintTop_toBottomOf="@+id/imageView5"
            android:layout_marginLeft="440dp"
            app:layout_constraintLeft_toLeftOf="parent"
            android:layout_marginTop="110dp" />
 
        <ImageView
            android:id="@+id/imageView7"
            android:layout_width="92dp"
            android:layout_height="48dp"
            app:srcCompat="@drawable/gardon"
            app:layout_constraintTop_toBottomOf="@+id/imageView5"
            android:layout_marginLeft="440dp"
            app:layout_constraintLeft_toLeftOf="parent"
            android:layout_marginTop="110dp"
             />
 
    </android.support.constraint.ConstraintLayout>
 
</ScrollView>
je pense que je devrai utiliser un relativelayout mais je n'ai pas réussi à implementer le scrollview correctement avec

Merci d'avance de vos suggestions

ce que donne mon design

Nom : Capture.PNG
Affichages : 229
Taille : 31,2 Ko