Note that there are some explanatory texts on larger screens.

plurals
  1. POlayout_gravity doesnt work
    primarykey
    data
    text
    <p>I have a layout with 7 buttons, I want 6 of them centered in the screen and the last one at bottom. </p> <p><img src="https://i.stack.imgur.com/411dz.png" alt="enter image description here"></p> <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/background" android:orientation="vertical" &gt; &lt;LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="center" android:orientation="vertical" &gt; &lt;ImageButton android:id="@+id/account_but" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="50dip" android:background="@null" android:contentDescription="@string/accountDesc" android:src="@drawable/boton_usos" /&gt; &lt;ImageButton android:id="@+id/alquilar_but" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="5dip" android:background="@null" android:contentDescription="@string/alquilarDesc" android:src="@drawable/boton_alquilar" /&gt; &lt;ImageButton android:id="@+id/paradas_but" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="5dip" android:background="@null" android:contentDescription="@string/paradasDesc" android:src="@drawable/boton_paradas" /&gt; &lt;ImageButton android:id="@+id/noticias_but" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="5dip" android:background="@null" android:contentDescription="@string/noticiasDesc" android:src="@drawable/boton_noticias" /&gt; &lt;ImageButton android:id="@+id/incidencia_but" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="5dip" android:background="@null" android:contentDescription="@string/incidenciaDesc" android:src="@drawable/boton_incidencia" /&gt; &lt;ImageButton android:id="@+id/informacion_but" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="5dip" android:background="@null" android:contentDescription="@string/infoDesc" android:src="@drawable/boton_informacion" /&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="bottom" android:orientation="vertical" &gt; &lt;ImageButton android:id="@+id/sabadell_but" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/banner_sabadell" android:contentDescription="@string/infoDesc" /&gt; &lt;/LinearLayout&gt; &lt;/LinearLayout&gt; </code></pre> <p>With this code, I got the buttons start at left top.</p> <p>How can I fix it?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload