Comment faire pour créer la mise en page avec 6 boutons des fenêtres comme les tuiles

Je suis en train de créer une mise en page avec 6 boutons qui s'adaptent automatiquement à la taille de l'écran que les tuiles de windows phone. Dans le code que j'ai créer dynamiquement le bouton 6, 2 pour la ligne, mais le bouton doit s'adapter à la taille de l'écran de remplissage de ce dernier. comment puis-je procéder?

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<LinearLayout
    android:layout_width="match_parent"
        android:layout_height="0dip"
    android:orientation="horizontal"
    android:weightSum="2" >

    <Button
        android:layout_width="0dip"
                android:layout_height="match_parent"
        android:layout_weight="1"
        android:background="@drawable/conv_up" />

    <Button
        android:layout_width="0dip"
                android:layout_height="match_parent"
        android:layout_weight="1"
        android:background="@drawable/conv_up"
         />

</LinearLayout>

<LinearLayout
    android:layout_width="match_parent"
        android:layout_height="0dip"
    android:orientation="horizontal"
    android:weightSum="2" >

    <Button
        android:layout_width="0dip"
                android:layout_height="match_parent"
        android:layout_weight="1"
        android:background="@drawable/conv_up"
        />

    <Button
        android:layout_width="0dip"
                android:layout_height="match_parent"
        android:layout_weight="1"
        android:background="@drawable/conv_up"
         />

</LinearLayout>

<LinearLayout
    android:layout_width="match_parent"
        android:layout_height="0dip"
    android:orientation="horizontal"
    android:weightSum="2" >

    <Button
        android:layout_width="0dip"
                android:layout_height="match_parent"
        android:layout_weight="1"
        android:background="@drawable/conv_up"
         />

    <Button
        android:layout_width="0dip"
                android:layout_height="match_parent"
        android:layout_weight="1"
        android:background="@drawable/conv_up"
        />

</LinearLayout>
Mettez ce que vous voyez maintenant, et ce que vous attendez. Sinon, il sera difficile de répondre.
Je ne vois rien parce que ce code me donne cette erreur: "Suspects taille: cela permettra de rendre la vue invisible, doit être utilisé avec layout_weight" sur LinearLayout android:layout_height="0dip"
0dip est la question.
Le problème a été en raison de l'absence android:layout_weight="1" propriété de les trois LinearLayout enfants. J'ai posté un XML complet dans ma réponse.
Est GridLayout une solution?

OriginalL'auteur bisemanu | 2013-05-09