Bonjour,
J'essaye de faire une scroolView contenant des LinearLayout mais voila arriver a mon deuxième LinearLayout les ImageButton ne se positionne pas comme désirée.
Voici ce que sa donne.

Nom : 1.png
Affichages : 155
Taille : 39,9 Ko

Voici le code

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
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
    android:layout_height="match_parent"
 
 
    tools:context=".layout_choix_activity">
 
 
 
    <LinearLayout
        android:id="@+id/block"
        android:orientation="vertical"
        android:layout_width="wrap_content"
        android:layout_height="match_parent">
    <LinearLayout
        android:orientation="horizontal"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        >
 
    <ImageButton
        android:scaleType="fitCenter"
        android:adjustViewBounds="true"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:src="@drawable/restaurant"
        android:id="@+id/restaurant"
        android:layout_weight="1.0"
 
        />
    <ImageButton
        android:scaleType="fitCenter"
        android:adjustViewBounds="true"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/party"
        android:id="@+id/party"
        android:layout_weight="1.0"
 
        />
 
        <ImageButton
            android:scaleType="fitCenter"
            android:adjustViewBounds="true"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/sport"
            android:id="@+id/sport"
            android:layout_weight="1.0"
 
            />
 
    </LinearLayout>
 
 
    <LinearLayout
 
        android:layout_width="match_parent"
        android:layout_height="128dp"
        android:orientation="horizontal"
        >
        <ImageButton
 
            android:scaleType="fitCenter"
            android:adjustViewBounds="true"
            android:src="@drawable/cinema"
            android:id="@+id/cinema"
            android:layout_width="wrap_content"
            android:layout_height="match_parent" />
        <ImageButton
            android:scaleType="fitCenter"
            android:adjustViewBounds="true"
            android:src="@drawable/promenade"
            android:id="@+id/promenade"
            android:layout_weight="1.0"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
 
        <ImageButton
            android:scaleType="fitCenter"
            android:adjustViewBounds="true"
            android:src="@drawable/verre"
            android:id="@+id/verre"
            android:layout_weight="1.0"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
 
    </LinearLayout>
 
 
   </LinearLayout>
 
 
</ScrollView>
J'aimerais que le deuxième LinearLayout se comporte comme le premier.
Merci de votre aide.