Bonjour;
Pour mon plaisir, et par défis, je débute une application sous android. Le code commence à avancer, mais je n'arrive pas à fair un truc tout bète:
J'ai trois parties dans mon visuel:
une partie en haut sur toute la longueur de l'écran, de la hauteur d'un bouton.
en dessous:
à gauche, j'ai une colonne qui fait toute la hauteur avec juste trois 'imagebutton' (toutes les images utilisé font 100px x 100px)
à droite, un liste view.
J'ai mis chacune des parties dans un linearlayout et positionné le tout correctement.

Mon problème, c'est que mes trois imagebutton sont collés en haut dans leur container!!
Et je n'arrive pas à les "centrer" : je voudrais juste mettre un tout en haut, un au milieu et un tout en bas!
Je vous donne mon fichier, ce sera plus parlant:
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
 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity"
    android:weightSum="1">
 
    <LinearLayout
        android:orientation="horizontal"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="top"
        android:id="@+id/layout1"
        android:background="#ffdcff3c">
        <TextView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="@string/etat_connexion"
            android:id="@+id/etat_connexion"
            android:layout_weight="1"
            android:layout_gravity="left|center_vertical" />
        <Button
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="@string/connexion"
            android:id="@+id/connexion"
            android:layout_weight="2"
            android:layout_gravity="right" />
    </LinearLayout>
    <LinearLayout
        android:orientation="vertical"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:id="@+id/layout2"
        android:layout_below="@id/layout1"
        android:background="#ff73fff0">
        <ImageButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/boutonhaut"
            android:layout_weight="40"
            android:background="@mipmap/haut" />
        <ImageButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/boutonstop"
            android:layout_gravity="center_vertical"
            android:layout_weight="40"
            android:background="@mipmap/stop" />
        <ImageButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/boutonbas"
            android:layout_gravity="bottom"
            android:layout_weight="40"
            android:background="@mipmap/bas" />
    </LinearLayout>
    <LinearLayout
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_below="@id/layout1"
        android:layout_toRightOf="@id/layout2"
        android:id="@+id/layout3"
        android:background="#ffff3e96" />
        <ListView
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:id="@+id/listView" />
    </LinearLayout>
</RelativeLayout>
Les couleurs, en background, utilisées , sont juste la pour faire ressortir mes layout. J'ai testé pas mal de choses, mais là je sèche.
Si vous pouvez m'aider et m'expliquer; ce serait aimable.

Merci.
Rémi.