title: Android: included layout not filling parent width
body: <p>I have a main layout in which I include two inner layouts. I am specifying the width of the included layouts to match_parent but they don't occupy the entire width of the parent. </p>
  
  <p>I may have more components in each inner LinearLayout for e.g., three left buttons and three right buttons. Below is a simplified example of my code</p>
  
  <p>See example below:
  main_layout.xml</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:paddingTop="5dp"
      android:baselineAligned="false"
      android:orientation="vertical" &gt;
  
      &lt;TableLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_weight="0.95" &gt;
  
          &lt;TableRow
              android:id="@+id/tableRow1"
              android:layout_weight="0.8"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginBottom="5dp" &gt;
  
              &lt;include layout="@layout/child_layout"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content" /&gt;
          &lt;/TableRow&gt;
  
          &lt;TableRow
              android:id="@+id/tableRow2"
              android:layout_weight="0.2"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginBottom="5dp" &gt;
  
              &lt;include layout="@layout/child_layout"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content" /&gt;
          &lt;/TableRow&gt;
      &lt;/TableLayout&gt;
  
      &lt;LinearLayout
           android:layout_width="match_parent"
           android:layout_height="50dp"
           android:layout_weight="0.05"
           android:gravity="center"
           android:orientation="vertical"&gt;  
  
          &lt;Button
             android:layout_width="80dp"
             android:layout_height="40dp"
             android:textSize="14sp"
             android:textStyle="bold"
             android:text="Bottom" /&gt;
      &lt;/LinearLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>child_layout</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal" &gt;
  
      &lt;LinearLayout
          android:id="@+id/leftLayout"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentLeft="true"
          android:orientation="vertical" &gt;
  
          &lt;Button
              android:layout_width="80dp"
              android:layout_height="40dp"
              android:textSize="14sp"
              android:textStyle="bold"
              android:text="Left" /&gt;
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
          android:id="@+id/rightLayout"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentRight="true"
          android:orientation="vertical" &gt;
  
         &lt;Button
             android:layout_width="80dp"
             android:layout_height="40dp"
             android:textSize="14sp"
             android:textStyle="bold"
             android:text="Right" /&gt;
      &lt;/LinearLayout&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Notice that the left and right buttons are overlapped in the image.<img src="https://i.stack.imgur.com/lrZWC.png" alt="enter image description here">. How do I expand the included layout to fill the entire width of the parent so that the left and right buttons appear on left and right. Thank You.</p>