title: RelativeLayout height to fill remaining space
body: <p>I have the following layout in my xml file:</p>
  
  <pre><code>&lt;RelativeLayout android:layout_width="fill_parent"
                  android:layout_height="fill_parent"&gt;
  
      &lt;FrameLayout android:id="@+id/logoLayout"  
                   android:layout_width="fill_parent"
               android:layout_height="wrap_content"&gt;
            -- some images
      &lt;/FrameLayout&gt;
  
  
      &lt;RelativeLayout android:layout_width="fill_parent" 
                      android:layout_height="wrap_content" 
                      android:gravity="center" 
                      android:orientation="vertical"
                      android:layout_below="@+id/logoLayout"&gt;
  
                 Button 1
                 Button 2
                 Button 3
                 Button 4
  
      &lt;/RelativeLayout&gt;
  
      &lt;RelativeLayout android:orientation="horizontal"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:layout_margin="5dip"
              android:layout_alignParentBottom="true"&gt;
  
                   Button 5
      &lt;/RelativeLayout&gt;
  
  &lt;RelativeLayout&gt;
  </code></pre>
  
  <p>Maybe I didn't do it in the best way. What I want: have the Layout that contains the 4 buttons to use the entire space between the top and bottom layout, and I want to have the button equally arranged in the layout.</p>
  
  <p>Something like this:<a href="http://img16.imageshack.us/i/androidq.png/" rel="noreferrer">http://img16.imageshack.us/i/androidq.png/</a></p>
  
  <p>I add the whole layout code:</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/background"&gt;
  
  
      &lt;!--The header of the page--&gt;
          &lt;FrameLayout android:id="@+id/logoLayout" 
                       android:layout_width="fill_parent"
                       android:layout_height="wrap_content"&gt;        
  
               &lt;ImageView android:id="@+id/logoBackground" 
                          android:src="@drawable/logo_background_small"
                          android:layout_width="fill_parent" 
                          android:layout_height="wrap_content"/&gt;
  
               &lt;ImageView android:id="@+id/logoImage" 
                          android:src="@drawable/logo_small"
                          android:layout_width="wrap_content" 
                          android:layout_height="wrap_content" 
                          android:layout_gravity="left"
                          android:gravity="center"
                          android:padding="3dip"/&gt;  
  
               &lt;TextView android:layout_width="fill_parent" 
                         android:layout_height="wrap_content" 
                         android:text="@string/tracks"
                         android:layout_gravity="center"
                         android:gravity="right"
                         android:textSize="22dip"
                         android:textColor="#ffffff"
                         android:padding="3dip"&gt;
               &lt;/TextView&gt;              
  
          &lt;/FrameLayout&gt;
  
  
          &lt;RelativeLayout  xmlns:android="http://schemas.android.com/apk/res/android"
                           android:layout_width="fill_parent" 
                           android:layout_height="wrap_content" 
                           android:gravity="center" 
                           android:orientation="vertical"
                           android:layout_below="@+id/logoLayout"&gt; 
  
                              &lt;Button android:id="@+id/btn1"
                                      android:layout_height="wrap_content" 
                                      android:layout_width="250dip" 
                                      android:drawableLeft="@drawable/img_small_btn_look_around"
                                      android:background="@drawable/main_long_menu_button"
                                      android:text="@string/btn1" 
                                      android:textSize="18dip"
                                      android:textColor="#ffffff"
                                      android:layout_marginTop="20dip"
                                      android:onClick="btnMyTracksOnClick"&gt;
                              &lt;/Button&gt; 
  
                              &lt;Button android:id="@+id/btn2"
                                      android:layout_height="wrap_content" 
                                      android:layout_width="250dip" 
                                      android:drawableLeft="@drawable/img_small_btn_look_around"
                                      android:background="@drawable/main_long_menu_button"
                                      android:text="@string/btn2" 
                                      android:textSize="18dip"
                                      android:textColor="#ffffff"
                                      android:layout_marginTop="20dip"
                                      android:layout_below="@+id/btn1"&gt;
                              &lt;/Button&gt;
  
                              &lt;Button android:id="@+id/btn3"
                                      android:layout_height="wrap_content" 
                                      android:layout_width="250dip" 
                                      android:drawableLeft="@drawable/img_small_btn_look_around"
                                      android:background="@drawable/main_long_menu_button"
                                      android:text="@string/btn3" 
                                      android:textSize="18dip"
                                      android:textColor="#ffffff"
                                      android:layout_marginTop="20dip"
                                      android:layout_below="@+id/btn2"&gt;
                              &lt;/Button&gt;
  
                              &lt;Button android:id="@+id/btn4"
                                      android:layout_height="wrap_content" 
                                      android:layout_width="250dip" 
                                      android:drawableLeft="@drawable/img_small_btn_look_around"
                                      android:background="@drawable/main_long_menu_button"
                                      android:text="@string/btn4" 
                                      android:textSize="18dip"
                                      android:textColor="#ffffff"
                                      android:layout_marginTop="20dip"
                                      android:layout_below="@+id/bt3"&gt;
                              &lt;/Button&gt;
          &lt;/RelativeLayout&gt;
  
          &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                          android:orientation="horizontal"
                          android:layout_width="fill_parent"
                          android:layout_height="wrap_content"
                          android:layout_margin="5dip"
                          android:layout_alignParentBottom="true"&gt;
  
                          &lt;Button android:layout_width="90dip" 
                                  android:layout_height="wrap_content"
                                  android:textSize="20dip"
                                  android:textColor="#ffffff"
                                  android:layout_alignParentLeft="true"
                                  android:background="@drawable/sett_menu_button"
                                  android:text="@string/back" 
                                  android:layout_marginLeft="3dip"/&gt; 
  
           &lt;/RelativeLayout&gt;
  
      &lt;/RelativeLayout&gt;
  </code></pre>