Posté(e) 16 février 201115 a Salut, J'aimerai savoir comment faire pour avoir un tableau de 2x2 avec des cases de dimensions fixes et égales. (cf pièce jointe ) J'arrive à obtenir quelque chose de bien lorsque les cases sont vides, mais dès que j'y introduit quelque chose, les dimensions "éclatent"... Voici mon code <?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:background="#FFF" android:orientation="vertical"> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/cadre2" android:gravity="center"> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center" android:text="TEXTE HAUT"/> </LinearLayout> <TableLayout android:id="@+id/TableLayout01" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:background="@drawable/cadre2" android:layout_marginTop="2dp" android:layout_marginBottom="2dp" android:padding="5dip" android:stretchColumns="*"> <TableRow android:layout_weight="1"> <ImageView android:id="@+id/ImageView01" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/cadre2" android:adjustViewBounds="true" android:scaleType="fitCenter" > </ImageView> <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/cadre2" android:orientation="vertical"> </LinearLayout> </TableRow> <TableRow android:layout_weight="1"> <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/cadre2" android:orientation="vertical"> </LinearLayout> <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/cadre2" android:orientation="vertical"> </LinearLayout> </TableRow> </TableLayout> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/cadre2" android:gravity="center" android:paddingTop="10dp" android:paddingBottom="10dp"> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center" android:text="TEXTE BAS"/> </LinearLayout> </LinearLayout> Merci! Modifié 16 février 201115 a par Bertrand31
Posté(e) 7 mars 201115 a Coucou! A priori, je jouerais avec les propriétés WeightSum et LayoutWeight... Cela devrait régler ton souci...
Archivé
Ce sujet est désormais archivé et ne peut plus recevoir de nouvelles réponses.