title: Button below listView in DialogFragment
body: <p>I'm trying to code a dialogFragment which contains a ListView and a button below that ListView.
  The button must be always visible, this means that you can scroll the ListView but the button remains always visible.</p>
  
  <p>The Dialog must also adapt its height. That means that if the listView contains only fews elements (1 or 2 elements) the DialogFragment should not fill the entire height of the screen...</p>
  
  <p>This is my code:</p>
  
  <blockquote>
    <p></p>
  </blockquote>
  
  <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="match_parent"
      android:layout_height="wrap_content"&gt;
      &lt;LinearLayout
          android:orientation="vertical"
          android:padding="@dimen/fragment_default_padding"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"&gt;
          &lt;ImageView
              android:layout_width="40dp"
              android:layout_height="40dp"
              android:src="@drawable/Back_arrow"
              android:id="@+id/imgBack" /&gt;
          &lt;TextView
              android:text="@string/this_pizzeria_require_a_phone_number_inorderto_accept_orders"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              style="@style/default_title" /&gt;
          &lt;EditText
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:id="@+id/edtPhoneNumber"
              android:layout_marginBottom="4dp"
              android:singleLine="true"
              android:imeOptions="actionDone"
              android:hint="@string/choose_from_the_below_list_or_insert_a_new_one_here"
              android:inputType="phone" /&gt;
          &lt;ListView
              android:id="@+id/lvPhones"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_above="@+id/btnAdd"
              android:dividerHeight="1dp" /&gt;
          &lt;Button
              android:id="@+id/btnDone"
              android:text="@string/done"
              style="@style/default_button" /&gt;
      &lt;/LinearLayout&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>This code works fine, but if the listView contains a lot of items, the button below disappear.
  This is a screen of the dialog:
  <img src="https://i.stack.imgur.com/IMdXx.png" alt="enter image description here"></p>
  
  <p>As you can see the button is stretched, and adding another item to the listView, it disappears.</p>
  
  <p>Is there a way to achieve my goal?</p>
  
  <p>Thanks a lot!</p>