title: How to equalize spaces between buttons?
body: <p>I need to equalize spaces between four buttons. Is there any way this could be done? The problem is that first and last buttons needs to be near the edge, and the remaining space should be equally divided for remaining two buttons and three spaces. </p>
  
  <p><img src="https://i.stack.imgur.com/PSiNm.png" alt=""></p>
  
  <p>layout/main.xml:</p>
  
  <pre><code>&lt;LinearLayout
      android:id="@+id/setupButtons"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal" &gt;
  
      &lt;LinearLayout
          android:layout_width="wrap_content"
          android:layout_height="wrap_content" &gt;
  
          &lt;Button
              android:id="@+id/setupButtonA1"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:background="@drawable/button_arrow_up"
              android:enabled="true" /&gt;
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
          android:layout_width="wrap_content"
          android:layout_height="wrap_content" 
          android:layout_weight="1"&gt;
  
          &lt;Button
              android:id="@+id/setupButtonA2"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:background="@drawable/button_arrow_down"
              android:layout_weight="0.5"
              android:enabled="true" /&gt;
  
          &lt;Button
              android:id="@+id/setupButtonB1"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:background="@drawable/button_arrow_up"
              android:layout_weight="0.5"
              android:enabled="false" /&gt;
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
          android:layout_width="wrap_content"
          android:layout_height="wrap_content" &gt;
  
          &lt;Button
              android:id="@+id/setupButtonB2"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:background="@drawable/button_arrow_down"
              android:enabled="false" /&gt;
      &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <hr>
  
  <p>Thank you for all of your answers, the correct <strong>solution</strong> was:</p>
  
  <pre><code>&lt;LinearLayout
      android:id="@+id/setupButtons"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal" &gt;
  
      &lt;Button
          android:id="@+id/setupButtonA1"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:background="@drawable/button_arrow_up"
          android:enabled="true" /&gt;
  
      &lt;View
          android:layout_width="0dp"
          android:layout_height="match_parent"
          android:layout_weight="1" /&gt;
  
      &lt;Button
          android:id="@+id/setupButtonA2"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:background="@drawable/button_arrow_down"
          android:enabled="true" /&gt;
  
      &lt;View
          android:layout_width="0dp"
          android:layout_height="match_parent"
          android:layout_weight="1" /&gt;
  
      &lt;Button
          android:id="@+id/setupButtonB1"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:background="@drawable/button_arrow_up"
          android:enabled="false" /&gt;
  
      &lt;View
          android:layout_width="0dp"
          android:layout_height="match_parent"
          android:layout_weight="1" /&gt;
  
      &lt;Button
          android:id="@+id/setupButtonB2"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:background="@drawable/button_arrow_down"
          android:enabled="false" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>