title: Android Linear Layout not filling Scrollview
body: <p>I don't understand why I'm unable to get the linear layout (blue outline) to extend to the full size of the scrollview (the red, green and black areas) in the pic below.  I've tried different combinations of gravity and fill but no luck. What am I missing?</p>
  
  <p><img src="https://i.stack.imgur.com/sQSle.png" alt="enter image description here"> </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="wrap_content"
      android:layout_height="wrap_content"
      android:orientation="vertical" &gt;
  
      &lt;RelativeLayout
          android:id="@+id/top_control_bar"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content" &gt;
  
          &lt;LinearLayout
              android:id="@+id/linearLayout1"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:background="#111111"
              android:orientation="vertical" &gt;
  
              &lt;LinearLayout
                  android:layout_width="fill_parent"
                  android:layout_height="wrap_content"
                  android:minHeight="60dip"
                  android:orientation="horizontal" &gt;
  
                  &lt;TextView
                      android:id="@+id/header"
                      android:layout_width="fill_parent"
                      android:layout_height="fill_parent"
                      android:layout_weight="50"
                      android:background="#999999"
                      android:gravity="center"
                      android:text="Title"
                      android:textColor="#FFFFFF"
                      android:textSize="18sp"
                      android:textStyle="bold" /&gt;
  
              &lt;/LinearLayout&gt;
          &lt;/LinearLayout&gt;
      &lt;/RelativeLayout&gt;
  
      &lt;LinearLayout
          android:id="@+id/bottom_control_bar"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_alignParentBottom="true"
          android:gravity="center"
          android:orientation="vertical" &gt;
  
          &lt;LinearLayout
              android:id="@+id/pagebar"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:background="#FFFF00"
              android:gravity="bottom|center"
              android:minHeight="70dip"
              android:orientation="horizontal" &gt;
  
              &lt;FrameLayout
                  android:layout_width="wrap_content"
                  android:layout_height="fill_parent"
                  android:layout_marginRight="10dip" &gt;
  
                  &lt;ImageButton
                      android:id="@+id/b_p1"
                      android:layout_width="58dip"
                      android:layout_height="58dip"
                      android:layout_gravity="top"
                      android:layout_marginTop="5dip"
                      android:adjustViewBounds="true"
                      android:clickable="true"
                      android:focusable="true"
                      android:scaleType="fitCenter"
                      android:src="@drawable/ic_launcher" /&gt;
  
                  &lt;TextView
                      android:id="@+id/tv_p1"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_gravity="bottom|center"
                      android:clickable="false"
                      android:focusable="false"
                      android:text="page1"
                      android:textSize="10sp" /&gt;
              &lt;/FrameLayout&gt;
  
  
  
  
              &lt;FrameLayout
                  android:layout_width="wrap_content"
                  android:layout_height="fill_parent"
                  android:layout_marginRight="10dip" &gt;
  
                  &lt;ImageButton
                      android:id="@+id/b_p2"
                      android:layout_width="58dip"
                      android:layout_height="58dip"
                      android:layout_gravity="top"
                      android:layout_marginTop="5dip"
                      android:adjustViewBounds="true"
                      android:clickable="true"
                      android:focusable="true"
                      android:scaleType="fitCenter"
                      android:src="@drawable/ic_launcher" /&gt;
  
                  &lt;TextView
                      android:id="@+id/tv_p2"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_gravity="bottom|center"
                      android:clickable="false"
                      android:focusable="false"
                      android:text="page2"
                      android:textSize="10sp" /&gt;
              &lt;/FrameLayout&gt;
  
  
  
  
              &lt;FrameLayout
                  android:layout_width="wrap_content"
                  android:layout_height="fill_parent"
                  android:layout_marginRight="10dip" &gt;
  
                  &lt;ImageButton
                      android:id="@+id/b_p3"
                      android:layout_width="58dip"
                      android:layout_height="58dip"
                      android:layout_gravity="top"
                      android:layout_marginTop="5dip"
                      android:adjustViewBounds="true"
                      android:clickable="true"
                      android:focusable="true"
                      android:scaleType="fitCenter"
                      android:src="@drawable/ic_launcher" /&gt;
  
                  &lt;TextView
                      android:id="@+id/tv_p3"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_gravity="bottom|center"
                      android:clickable="false"
                      android:focusable="false"
                      android:text="page3"
                      android:textSize="10sp" /&gt;
              &lt;/FrameLayout&gt;
  
  
  
  
  
              &lt;FrameLayout
                  android:layout_width="wrap_content"
                  android:layout_height="fill_parent"
                  android:layout_marginRight="10dip" &gt;
  
                  &lt;ImageButton
                      android:id="@+id/b_p4"
                      android:layout_width="58dip"
                      android:layout_height="58dip"
                      android:layout_gravity="top"
                      android:layout_marginTop="5dip"
                      android:adjustViewBounds="true"
                      android:clickable="true"
                      android:focusable="true"
                      android:scaleType="fitCenter"
                      android:src="@drawable/ic_launcher" /&gt;
  
                  &lt;TextView
                      android:id="@+id/tv_p4"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_gravity="bottom|center"
                      android:clickable="false"
                      android:focusable="false"
                      android:text="page4"
                      android:textSize="10sp" /&gt;
              &lt;/FrameLayout&gt;
  
  
          &lt;/LinearLayout&gt;
      &lt;/LinearLayout&gt;
  
      &lt;ScrollView
          android:id="@+id/scrollView1"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:layout_above="@id/bottom_control_bar"
          android:layout_below="@id/top_control_bar"
          android:measureAllChildren="false" &gt;
  
          &lt;LinearLayout
              android:id="@+id/linlay1"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:background="#770000"
              android:clipChildren="true"
              android:duplicateParentState="false"
              android:fitsSystemWindows="false"
              android:orientation="vertical" &gt;
  
              &lt;LinearLayout
                  android:id="@+id/searchbar"
                  android:layout_width="fill_parent"
                  android:layout_height="fill_parent"
                  android:minHeight="60dip"
                  android:orientation="horizontal" &gt;
  
                  &lt;EditText
                      android:id="@+id/query"
                      android:layout_width="fill_parent"
                      android:layout_height="wrap_content"
                      android:layout_gravity="left|center_vertical"
                      android:layout_marginLeft="5dip"
                      android:layout_marginRight="5dip"
                      android:layout_weight="20"
                      android:imeOptions="actionSearch"
                      android:lines="1" &gt;
  
                      &lt;requestFocus /&gt;
                  &lt;/EditText&gt;
  
                  &lt;Button
                      android:id="@+id/btn_cancel"
                      android:layout_width="fill_parent"
                      android:layout_height="wrap_content"
                      android:layout_gravity="right|center_vertical"
                      android:layout_weight="60"
                      android:drawablePadding="5dip"
                      android:gravity="center"
                      android:hapticFeedbackEnabled="true"
                      android:maxHeight="48dip"
                      android:minHeight="48dip"
                      android:text="Search"
                      android:textSize="12sp"
                      android:textStyle="bold" /&gt;
              &lt;/LinearLayout&gt;
  
              &lt;LinearLayout
                  android:id="@+id/buttons"
                  android:layout_width="fill_parent"
                  android:layout_height="fill_parent"
                  android:minHeight="60dip"
                  android:orientation="horizontal" &gt;
  
                  &lt;Button
                      android:id="@+id/btn_1"
                      android:layout_width="fill_parent"
                      android:layout_height="wrap_content"
                      android:layout_gravity="center_vertical|center_horizontal"
                      android:layout_weight="60"
                      android:drawablePadding="5dip"
                      android:gravity="center"
                      android:hapticFeedbackEnabled="true"
                      android:maxHeight="48dip"
                      android:minHeight="48dip"
                      android:text="b1"
                      android:textSize="12sp"
                      android:textStyle="bold" /&gt;
  
                  &lt;Button
                      android:id="@+id/btn_2"
                      android:layout_width="fill_parent"
                      android:layout_height="wrap_content"
                      android:layout_gravity="center_vertical|center_horizontal"
                      android:layout_weight="60"
                      android:drawablePadding="5dip"
                      android:gravity="center"
                      android:hapticFeedbackEnabled="true"
                      android:maxHeight="48dip"
                      android:minHeight="48dip"
                      android:text="b2"
                      android:textSize="12sp"
                      android:textStyle="bold" /&gt;
  
                  &lt;Button
                      android:id="@+id/btn_3"
                      android:layout_width="fill_parent"
                      android:layout_height="wrap_content"
                      android:layout_gravity="center_vertical|center_horizontal"
                      android:layout_weight="60"
                      android:drawablePadding="5dip"
                      android:gravity="center"
                      android:hapticFeedbackEnabled="true"
                      android:maxHeight="48dip"
                      android:minHeight="48dip"
                      android:text="b3"
                      android:textSize="12sp"
                      android:textStyle="bold" /&gt;
  
                  &lt;Button
                      android:id="@+id/btn_4"
                      android:layout_width="fill_parent"
                      android:layout_height="wrap_content"
                      android:layout_gravity="center_vertical|center_horizontal"
                      android:layout_weight="60"
                      android:drawablePadding="5dip"
                      android:gravity="center"
                      android:hapticFeedbackEnabled="true"
                      android:maxHeight="48dip"
                      android:minHeight="48dip"
                      android:text="b4"
                      android:textSize="12sp"
                      android:textStyle="bold" /&gt;
              &lt;/LinearLayout&gt;
  
              &lt;LinearLayout
                  android:id="@+id/picbar"
                  android:layout_width="fill_parent"
                  android:layout_height="fill_parent"
                  android:orientation="vertical" &gt;
  
                  &lt;ImageView
                      android:id="@+id/imageView1"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_gravity="center"
                      android:src="@android:drawable/toast_frame" /&gt;
  
              &lt;/LinearLayout&gt;
  
              &lt;LinearLayout
                  android:id="@+id/actionbar"
                  android:layout_width="fill_parent"
                  android:layout_height="fill_parent"
                  android:layout_weight="10"
                  android:background="#007700"
                  android:orientation="horizontal" &gt;
  
                  &lt;Button
                      android:id="@+id/btn_warp"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_marginBottom="5dip"
                      android:layout_marginTop="5dip"
                      android:text="warp"
                      android:textSize="12sp"
                      android:textStyle="bold" /&gt;
              &lt;/LinearLayout&gt;
  
          &lt;/LinearLayout&gt;
      &lt;/ScrollView&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>