title: Set slider drawer height
body: <p>I have a slider drawer in my application. If I set wrap_content as a value for the layout_height field, the slider drawer will stretch on the whole screen. Using a constant as a height is not a good alternative either.
  Is it possible to have a slider drawer with the height of it's content?</p>
  <pre><code>  &lt;LinearLayout 
    android:layout_width=&quot;wrap_content&quot;
    android:layout_height=&quot;wrap_content&quot; 
    android:id=&quot;@+id/frameLayout&quot; 
    android:layout_gravity=&quot;bottom&quot;
    android:orientation=&quot;vertical&quot;&gt;
      &lt;View
        android:layout_width=&quot;wrap_content&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:layout_weight=&quot;1&quot; 
        android:background=&quot;@color/blue&quot;/&gt;
      &lt;SlidingDrawer 
          android:layout_width=&quot;fill_parent&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:layout_weight=&quot;1&quot; 
          android:handle=&quot;@+id/handle&quot; 
          android:content=&quot;@+id/content&quot;
          android:id=&quot;@+id/slide&quot; 
          android:orientation=&quot;vertical&quot;&gt;
      &lt;RelativeLayout android:id=&quot;@+id/handle&quot;
          android:layout_width=&quot;fill_parent&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:background=&quot;@drawable/list_header&quot;&gt; 
           &lt;TextView
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:layout_alignParentLeft=&quot;true&quot;
              android:layout_centerVertical=&quot;true&quot;
              android:layout_marginLeft=&quot;@dimen/padding&quot;
              android:textColor=&quot;@color/black&quot;
              android:textStyle=&quot;bold&quot;
              android:text=&quot;@string/ingredients_list_title&quot;/&gt;
           &lt;ImageView
              android:id=&quot;@+id/handle_indicator&quot;
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:layout_alignParentRight=&quot;true&quot;
              android:layout_centerVertical=&quot;true&quot;
              android:layout_marginRight=&quot;@dimen/padding&quot;
              android:src=&quot;@drawable/arrow_up&quot;
           /&gt;
      &lt;/RelativeLayout&gt;
      &lt;RelativeLayout android:id=&quot;@+id/content&quot;
          android:layout_width=&quot;fill_parent&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:background=&quot;@drawable/list_row_background&quot;&gt;
          &lt;LinearLayout android:id=&quot;@+id/list_ant_title&quot;
               android:layout_width=&quot;fill_parent&quot;
               android:layout_height=&quot;wrap_content&quot;
               android:layout_above=&quot;@+id/gallery&quot;
               android:orientation=&quot;vertical&quot;&gt;
                &lt;ListView 
                  android:id=&quot;@+id/listview&quot;
                  android:layout_width=&quot;fill_parent&quot; 
                  android:layout_height=&quot;wrap_content&quot;
                  android:divider=&quot;@drawable/divider&quot;
                  android:cacheColorHint=&quot;@color/transparent&quot;
                  android:fadingEdge=&quot;none&quot;/&gt;
          &lt;/LinearLayout&gt;
          &lt;Gallery 
              android:id=&quot;@+id/gallery&quot;
              android:layout_width=&quot;fill_parent&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:gravity=&quot;center_horizontal&quot;
              android:layout_alignParentBottom=&quot;true&quot;
              android:background=&quot;@drawable/list_row_background&quot;/&gt;
      &lt;/RelativeLayout&gt;
  &lt;/SlidingDrawer&gt;
  </code></pre>