title: let scrollview fill out whole screen except for height of relative layout at the bottom of the screen
body: <p>I'm stuck on how to fill the whole screen with a top layout except for the space needed for a bottom layout. I'm using relative layouts to place the layouts as needed, but I want my top view to take up all space except the space needed for my bottom view (the top view height will change depending on user input). See xml below. Right now, my top view will only take up as much space as the linearlayout inside the scrollview needs + the space that myTopButton takes up. 
  XML:</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="fill_parent"
          android:layout_height="fill_parent"
          android:background="@drawable/bg"
          android:paddingBottom="10dip"
          android:focusable="true"
          android:focusableInTouchMode="true"&gt;
     &lt;RelativeLayout android:id="@+id/topLayout"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_marginBottom="80dip"
          android:layout_alignParentTop="true"&gt;
       &lt;ScrollView android:id="@+id/myscroll"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_alignParentTop="true"
          android:layout_marginBottom="65dip"
          android:paddingRight="2dip"
          android:paddingLeft="6dip"
          android:fillViewport="true"&gt;
          &lt;LinearLayout style="@style/LinearLayoutInner"
          android:orientation="vertical"&gt;
          &lt;/LinearLayout&gt; 
      &lt;/ScrollView&gt;
      &lt;LinearLayout android:orientation="horizontal"
                      android:layout_width="fill_parent"
                      android:layout_height="wrap_content"
                      android:layout_alignParentBottom="true"&gt;
              &lt;Button android:id="@+id/search"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
                  android:layout_marginBottom="10dip"
                  android:text="@string/search_viewdoses"/&gt;
      &lt;/LinearLayout&gt;
     &lt;/RelativeLayout&gt;
     &lt;RelativeLayout android:id="@+id/bottomLayout"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:orientation="horizontal"
          android:layout_marginTop="-60dip"
          android:layout_alignParentBottom="true"&gt;
              &lt;TextView android:id="@+id/myText"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_alignParentBottom="true"
              android:layout_alignParentLeft="true"
              android:text="@string/mytext"&gt;&lt;/TextView&gt;
              &lt;EditText android:id="@+id/myEdit" 
                  android:layout_width="80dip"
                  android:layout_height="50dip"
              android:layout_alignParentBottom="true"
              android:layout_toRightOf="@+id/myText"
              android:singleLine="true"
              android:inputType="numberDecimal"&gt;&lt;/EditText&gt;
              &lt;Button android:id="@+id/save"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_alignParentBottom="true"
              android:layout_alignParentRight="true"
              android:layout_marginBottom="10dip"
                  android:text="@string/mybuttontext"/&gt;
      &lt;/RelativeLayout&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>SCREEN NOW: <img src="https://i.stack.imgur.com/c76oj.jpg" alt="enter image description here">  </p>
  
  <p>SCREEN WANTED: <img src="https://i.stack.imgur.com/ccuER.jpg" alt="enter image description here"></p>