Mettre les boutons en bas de l'écran avec LinearLayout?

J'ai le code suivant, comment puis-je faire en sorte que les 3 boutons sont en bas?

    <TextView
        android:id="@+id/textView1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="60dp"
        android:gravity="center"
        android:text="@string/observer"
        android:textAppearance="?android:attr/textAppearanceLarge"
        tools:context=".asdf"
        android:weight="1" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >

        <Button
            android:id="@+id/button1"
            style="?android:attr/buttonStyleSmall"
            android:layout_width="145dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal|center"
            android:text="1" />

        <Button
            android:id="@+id/button2"
            style="?android:attr/buttonStyleSmall"
            android:layout_width="145dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal|center"
            android:text="2" />

        <Button
            android:id="@+id/button3"
            style="?android:attr/buttonStyleSmall"
            android:layout_width="145dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal|center"
            android:text="3" />
    </LinearLayout>

  • quel est ce point de vue enveloppé dans? un cadre de mise en page? relative de la mise en page?
  • Votre code contient une faute de frappe. Par android:weight="1" vous signifiait probablement android:layout_weight="1". Ce n'est pas votre problème.
  • double possible de Comment faire pour aligner les points de vue au bas de l'écran?
InformationsquelleAutor thedeepfield | 2013-02-08