title: Is it possible to evenly distribute buttons across the width of a LinearLayout
body: <p>I have a <code>LinearLayout</code> (oriented horizontally) that contains 3 buttons. I want the 3 buttons to have a fixed width and be evenly distributed across the width of the <code>LinearLayout</code>.</p>
  <p>I can manage this by setting the gravity of the <code>LinearLayout</code> to center and then adjusting the padding of the buttons, but this works for a fixed width and won't work for different devices or orientations.</p>
  <pre><code>&lt;LinearLayout
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;wrap_content&quot;
      android:gravity=&quot;center&quot;
      android:orientation=&quot;horizontal&quot;&gt;
  
      &lt;Button
          android:id=&quot;@+id/btnOne&quot;
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:width=&quot;120dp&quot; /&gt;
  
      &lt;Button
          android:id=&quot;@+id/btnTwo&quot;
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:width=&quot;120dp&quot; /&gt;
  
  
      &lt;Button
          android:id=&quot;@+id/btnThree&quot;
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:width=&quot;120dp&quot; /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>