title: Android bottom button bar & scroll view with dialog theme
body: <p>I am trying to display an Android activity with:</p>
  
  <ul>
  <li>a dialog theme;</li>
  <li>a title fixed at the top of the dialog;</li>
  <li>a button bar fixed at the bottom of the dialog;</li>
  <li>a scroll view in the middle.</li>
  </ul>
  
  <p>The layout I have written fulfills these criteria, except that the dialog always fills the full screen (see vertical screenshot at the bottom).</p>
  
  <p>This is my 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="wrap_content" android:layout_height="wrap_content"&gt;
  
      &lt;TextView android:id="@+id/header"
      android:layout_width="fill_parent" android:layout_height="wrap_content"
      android:layout_marginLeft="10dp" android:layout_marginRight="10dp"
      android:layout_marginTop="10dp" android:layout_marginBottom="10dp"
      android:gravity="center_vertical"
          android:textSize="18dip" android:textColor="#ffffff"
          android:text="Sample Layout" /&gt;
  
      &lt;LinearLayout android:id="@+id/controls" android:orientation="horizontal"
      android:layout_width="fill_parent" android:layout_height="wrap_content"
      android:layout_alignParentBottom="true"
      style="@android:style/ButtonBar"&gt;
          &lt;Button android:layout_width="wrap_content" android:layout_height="wrap_content"
          android:layout_weight="1" android:text="Yes" /&gt;
          &lt;Button android:layout_width="wrap_content" android:layout_height="wrap_content"
          android:layout_weight="1" android:text="No" /&gt;
      &lt;/LinearLayout&gt;
  
      &lt;ScrollView android:id="@+id/test" android:layout_below="@id/header"
      android:layout_above="@id/controls"
      android:layout_width="fill_parent" android:layout_height="wrap_content"
      android:layout_marginBottom="5dp" android:layout_marginLeft="5dp"
      android:layout_marginRight="5dp"&gt;
          &lt;TextView android:layout_width="fill_parent" android:layout_height="wrap_content"
          android:text="Lorem ipsum dolor sit amet, consectetur
          adipiscing elit. Integer dui odio, convallis vitae suscipit eu,
          tincidunt non mi. Vestibulum faucibus pretium purus vel adipiscing.
          Morbi mattis molestie risus vitae vehicula. [...]" /&gt;
      &lt;/ScrollView&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>In addition, the activity is styled with <code>@android:style/Theme.Dialog</code> and <code>android:windowNoTitle</code>.</p>
  
  <p>I'm not sure I understand why this layout expands to fill the whole screen. None of the views have a layout height set to <code>fill_parent</code>; the parent layout isn't set to <code>fill_parent</code> either.</p>
  
  <p>Does anyone know if what I want to do is possible, and if yes how to do it?</p>
  
  <h2>My current layout in horizontal mode</h2>
  
  <p><img src="https://i.stack.imgur.com/FC0iS.jpg" alt="Layout in horizontal mode."></p>
  
  <h2>My current layout in vertical mode</h2>
  
  <p><img src="https://i.stack.imgur.com/PLD21.jpg" alt="Layout in vertical mode."></p>