title: Android: can height of SlidingDrawer be set with wrap_content?
body: <p>I'm trying to implement a <code>SlidingDrawer</code> that will occupy the full screen width, but whose height is determined dynamically by its contents: in other words, standard <code>fill_parent</code> layout behaviour for the width and <code>wrap_content</code> for the height. That's exactly how I've specified it in the layout XML (see below) but the sliding drawer always opens to the full screen height. The height of my content varies, but typically it's only about half the screen height, so I end up with a big gap underneath it. What I'd like is for the content to sit neatly on the bottom of the screen.</p>
  
  <p>I've tried everything I can think of to fix it but nothing's worked so far. If I set the <code>SlidingDrawer</code>'s <code>layout_height</code> to a specific value (e.g. <code>160dip</code>) it works, but that's not what I need: it has to be dynamic. Of course I've made sure all the child elements have their height set to <code>wrap_content</code> too.</p>
  
  <p>The documentation on SlidingDrawer is a bit vague on this and I haven't been able to find any examples that do what I'm after either. If anyone can see where I'm going wrong I'd really appreciate your help!</p>
  
  <pre><code>&lt;RelativeLayout
      android:layout_width="fill_parent"
      android:layout_height="fill_parent" &gt;
  
      &lt;ViewFlipper
          android:id="@+id/ImageFlipper"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent" &gt;
  
          &lt;ImageView
              android:id="@+id/imageView0"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:scaleType="centerCrop" /&gt;
  
          &lt;ImageView
              android:id="@+id/imageView1"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:scaleType="centerCrop" /&gt;
  
          &lt;ImageView
              android:id="@+id/imageView2"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:scaleType="centerCrop" /&gt;
  
      &lt;/ViewFlipper&gt;
  
      &lt;SlidingDrawer
          android:id="@+id/infoDrawer"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:handle="@+id/infoDrawerHandle"
          android:content="@+id/infoDrawerContent"
          android:allowSingleTap="false"
          android:layout_alignParentBottom="true"
          android:orientation="vertical" &gt;
  
          &lt;!-- Sliding drawer handle --&gt;
          &lt;ImageView
              android:id="@id/infoDrawerHandle"
              android:src="@drawable/info_handle_closed"
              android:layout_width="wrap_content" 
              android:layout_height="wrap_content" /&gt;
  
          &lt;!-- Sliding drawer content: a scroller containing a group of text views
          laid out in a LinearLayout --&gt;
          &lt;ScrollView
              android:id="@id/infoDrawerContent"
              android:background="@drawable/info_background"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:fillViewport="false" &gt;
  
              &lt;LinearLayout
                  android:id="@id/infoDrawerContent"
                  android:orientation="vertical"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:paddingRight="5dip" &gt;
  
                  &lt;TextView
                      android:id="@+id/infoTitle"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:textColor="#ffffff"
                      android:textSize="16dip"
                      android:textStyle="bold" /&gt;
  
                  &lt;TextView
                      android:id="@+id/infoCreator"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:textColor="#ffffff"
                      android:textSize="14dip"
                      android:textStyle="italic"
                      android:paddingBottom="10dip" /&gt;
  
                  &lt;TextView
                      android:id="@+id/infoDescription"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:textColor="#ffffff"
                      android:textSize="14dip"
                      android:paddingBottom="10dip" /&gt;
  
                  &lt;TextView
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:textColor="#ffcc00"
                      android:textSize="14dip"
                      android:textStyle="bold"
                      android:text="@string/heading_pro_tip" /&gt;
  
                  &lt;TextView
                      android:id="@+id/infoProTip"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:textColor="#ffcc00"
                      android:textSize="14dip" /&gt;
  
              &lt;/LinearLayout&gt;    
  
          &lt;/ScrollView&gt;
  
      &lt;/SlidingDrawer&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>