Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'd use a vertical <code>LinearLayout</code> with three rows of same weight as children, each row being a horizontal <code>LinearLayout</code> having two children of same weights, which will make sure the full area is filled. For six buttons performance shouldn't be an issue.</p> <p>If performance is a concern, you can make the rows as <code>RelativeLayout</code>s and use a strut to split in half and position the two children based on that.</p> <p>When I say a <em>strut</em>, I mean this:</p> <pre><code>&lt;View android:id="@+id/strut" android:layout_width="0dp" android:layout_height="0dp" android:layout_centerHorizontal="true"/&gt; </code></pre> <p><strong>Update:</strong> Since you're trying the <code>LinearLayout</code>s, here's how you can deal with the heights and widths:</p> <p>The parent <code>LinearLayout</code> can have:</p> <pre><code>android:layout_width="match_parent" android:layout_height="match_parent" </code></pre> <p>The three <code>LinearLayout</code> children will have:</p> <pre><code>android:layout_width="match_parent" android:layout_height="0dip" </code></pre> <p>The <code>Button</code>s will have:</p> <pre><code>android:layout_width="0dip" android:layout_height="match_parent" </code></pre> <p>As you can notice, we have <code>0dip</code> for the property that weight is applied on (either on height if parent is vertical oriented, or width if parent is horizontal oriented), which will need to grow to fill in the space.</p> <p>Here's the full XML (buttons don't include drawables, so feel free to add yours):</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:layout_weight="1" &gt; &lt;Button android:layout_width="0dip" android:layout_height="match_parent" android:layout_weight="1" /&gt; &lt;Button android:layout_width="0dip" android:layout_height="match_parent" android:layout_weight="1"/&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:layout_width="match_parent" android:layout_height="0dip" android:orientation="horizontal" android:layout_weight="1" &gt; &lt;Button android:layout_width="0dip" android:layout_height="match_parent" android:layout_weight="1" /&gt; &lt;Button android:layout_width="0dip" android:layout_height="match_parent" android:layout_weight="1"/&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:layout_width="match_parent" android:layout_height="0dip" android:orientation="horizontal" android:layout_weight="1" &gt; &lt;Button android:layout_width="0dip" android:layout_height="match_parent" android:layout_weight="1" /&gt; &lt;Button android:layout_width="0dip" android:layout_height="match_parent" android:layout_weight="1" /&gt; &lt;/LinearLayout&gt; &lt;/LinearLayout&gt; </code></pre> <p>And the result: <img src="https://i.stack.imgur.com/WkiTf.jpg" alt="enter image description here"></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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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