Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to create layout with 6 buttons like windows tiles
    primarykey
    data
    text
    <p>I'm trying to create a layout with 6 buttons that automatically adapt to the screen size as the tiles of windows phone. In the code I create dynamically the 6 button, 2 for line but the button should fit the size of the screen filling the latter. how can I proceed?</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" &gt; &lt;LinearLayout android:layout_width="match_parent" android:layout_height="0dip" android:orientation="horizontal" android:weightSum="2" &gt; &lt;Button android:layout_width="0dip" android:layout_height="match_parent" android:layout_weight="1" android:background="@drawable/conv_up" /&gt; &lt;Button android:layout_width="0dip" android:layout_height="match_parent" android:layout_weight="1" android:background="@drawable/conv_up" /&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:layout_width="match_parent" android:layout_height="0dip" android:orientation="horizontal" android:weightSum="2" &gt; &lt;Button android:layout_width="0dip" android:layout_height="match_parent" android:layout_weight="1" android:background="@drawable/conv_up" /&gt; &lt;Button android:layout_width="0dip" android:layout_height="match_parent" android:layout_weight="1" android:background="@drawable/conv_up" /&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:layout_width="match_parent" android:layout_height="0dip" android:orientation="horizontal" android:weightSum="2" &gt; &lt;Button android:layout_width="0dip" android:layout_height="match_parent" android:layout_weight="1" android:background="@drawable/conv_up" /&gt; &lt;Button android:layout_width="0dip" android:layout_height="match_parent" android:layout_weight="1" android:background="@drawable/conv_up" /&gt; &lt;/LinearLayout&gt; </code></pre> <p></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.
 

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