Note that there are some explanatory texts on larger screens.

plurals
  1. POHaving images centred in columns
    primarykey
    data
    text
    <p>I have three ToggleButton elements, each of which is a 50x70px image. I want these images centred in columns across the page (i.e. there are three columns, each of which takes up 1/3rd of the page's width, and each of which has an image centred horizontally inside it), but if I use a LinearLayout or TableLayout the images get stretched to become 33% of the page's width each. What should I be doing?</p> <pre><code> &lt;LinearLayout android:orientation="horizontal" android:id="@+id/buttonTable" android:layout_width="fill_parent" android:layout_below="@+id/tv_people" android:layout_height="wrap_content" android:layout_weight="1"&gt; &lt;ToggleButton android:id="@+id/person1Button" android:gravity="center_horizontal" android:layout_weight="1" android:layout_width="51px" android:layout_height="68px" android:background="@drawable/person1_button" android:textOn="" android:textOff=""&gt;&lt;/ToggleButton&gt; &lt;ToggleButton android:id="@+id/person2Button" android:gravity="center_horizontal" android:layout_weight="1" android:layout_width="51px" android:layout_height="68px" android:background="@drawable/person2_button" android:textOn="" android:textOff=""&gt;&lt;/ToggleButton&gt; &lt;ToggleButton android:id="@+id/person3Button" android:gravity="center_horizontal" android:layout_weight="1" android:layout_width="51px" android:layout_height="68px" android:background="@drawable/person3_button" android:textOn="" android:textOff=""&gt;&lt;/ToggleButton&gt; &lt;/LinearLayout&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
    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