Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>First of all you should not have given button width 0, if you are giving it 0 then layout_weight will not work.</p> <p>Try giving width and height of Button to <code>wrap_content</code> </p> <p><strong>UPDATE , Try this</strong></p> <pre><code> &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:padding="10dip" &gt; &lt;LinearLayout android:id="@+id/relativeLayout2" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingLeft="4dp" &gt; &lt;Button android:id="@+id/button11" android:layout_width="0dp" android:layout_height="50dp" android:layout_weight="1" &gt; &lt;/Button&gt; &lt;Button android:id="@+id/button21" android:layout_width="0dp" android:layout_height="50dp" android:layout_weight="1" &gt; &lt;/Button&gt; &lt;Button android:id="@+id/button31" android:layout_width="0dp" android:layout_height="50dp" android:layout_weight="1" &gt; &lt;/Button&gt; &lt;Button android:id="@+id/button41" android:layout_width="0dp" android:layout_height="50dp" android:layout_weight="1" &gt; &lt;/Button&gt; &lt;Button android:id="@+id/button51" android:layout_width="0dp" android:layout_height="50dp" android:layout_weight="1" &gt; &lt;/Button&gt; &lt;Button android:id="@+id/button61" android:layout_width="0dp" android:layout_height="50dp" android:layout_weight="1" &gt; &lt;/Button&gt; &lt;Button android:id="@+id/Button71" android:layout_width="0dp" android:layout_height="50dp" android:layout_weight="1" &gt; &lt;/Button&gt; &lt;/LinearLayout&gt; </code></pre> <p></p> <p>the result is</p> <p><img src="https://i.stack.imgur.com/n9c4y.jpg" alt="enter image description here"></p>
 

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