title: Add listview within scrollview
body: <p>I want to have a scrollable list which also includes list view. I did research everywhere and no solution yet :( As per the code below, when I add ScrollView, the listview height becomes smaller (single row). I want the ListView height to be dynamic (based on the content) and also make the complete page scrollable. How do I achieve this? Or is there a way to create dynamic linear / relative list UI? Please suggest.</p>
  
  <p>XML code:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent" &gt;
  &lt;LinearLayout
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:paddingTop="@dimen/activity_horizontal_margin"
      android:orientation="vertical" &gt;
  
          &lt;RelativeLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content" 
          android:paddingLeft="@dimen/activity_horizontal_margin"
          android:paddingRight="@dimen/activity_horizontal_margin"&gt;
  
          &lt;TextView
          android:id="@+id/textView3"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="@string/kollege_name"
          android:width="170dp" /&gt;
  
          &lt;TextView
          android:id="@+id/textView2"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentRight="true"
          android:layout_alignParentTop="true"
          android:gravity="right"
          android:text="@string/grade_value"
          android:width="120dp" /&gt;
  
          &lt;TextView
          android:id="@+id/textView1"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignRight="@+id/textView2"
          android:layout_below="@+id/textView2"
          android:text="@string/code_value" /&gt;
          &lt;/RelativeLayout&gt;
  
          &lt;View
          android:layout_width="fill_parent"
          android:layout_height="1dp"
          android:layout_marginTop="10dp"
          android:layout_marginBottom="10dp"
          android:background="@android:color/darker_gray" /&gt;
  
  
          &lt;TextView
          android:id="@+id/textView4"
          android:paddingLeft="@dimen/activity_horizontal_margin"
          android:paddingRight="@dimen/activity_horizontal_margin"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:text="@string/your_fit"
          android:textSize="12sp" /&gt;
  
          &lt;ListView
          android:id="@+id/listview"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content" /&gt;
  
          &lt;View
          android:layout_width="fill_parent"
          android:layout_height="1dp"
          android:layout_marginTop="10dp"
          android:layout_marginBottom="10dp"
          android:background="@android:color/darker_gray" /&gt;
  
          &lt;RelativeLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content" 
          android:paddingLeft="@dimen/activity_horizontal_margin"
          android:paddingRight="@dimen/activity_horizontal_margin" &gt;
  
          &lt;TextView
              android:id="@+id/textView10"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="@string/tuition"
              android:textSize="12sp" /&gt;
  
          &lt;TextView
              android:id="@+id/textView11"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_alignParentRight="true"
              android:layout_alignParentTop="true"
  
              android:text="@string/tuition_value" /&gt;
  
          &lt;/RelativeLayout&gt;
  
  
          &lt;View
          android:layout_width="fill_parent"
          android:layout_height="1dp"
          android:layout_marginTop="10dp"
          android:layout_marginBottom="10dp"
          android:background="@android:color/darker_gray" /&gt;
  
          &lt;RelativeLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content" 
          android:paddingLeft="@dimen/activity_horizontal_margin"
          android:paddingRight="@dimen/activity_horizontal_margin" &gt;
  
          &lt;TextView
          android:id="@+id/textView12"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="@string/placements"
          android:textSize="12sp" /&gt;
  
          &lt;TextView
          android:id="@+id/textView13"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_below="@+id/textView12"
          android:text="@string/EXTC"
          android:layout_marginTop="3dp" /&gt;
  
          &lt;TextView
          android:id="@+id/textView14"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_below="@+id/textView13"
          android:text="@string/IT"
          android:layout_marginTop="3dp" /&gt;
  
          &lt;TextView
          android:id="@+id/textView15"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_below="@+id/textView14"
          android:text="@string/COMP"
          android:layout_marginTop="3dp" /&gt;
  
          &lt;TextView
          android:id="@+id/textView16"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_below="@+id/textView15"
          android:text="@string/MECH"
          android:layout_marginTop="3dp" /&gt;
  
          &lt;TextView
          android:id="@+id/textView17"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_below="@+id/textView16"
          android:text="@string/INST"
          android:layout_marginTop="3dp" /&gt;
          &lt;/RelativeLayout&gt;
  
          &lt;View
          android:layout_width="fill_parent"
          android:layout_height="1dp"
          android:layout_marginTop="10dp"
          android:layout_marginBottom="10dp"
          android:background="@android:color/darker_gray" /&gt;
  
  
          &lt;RelativeLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:paddingLeft="@dimen/activity_horizontal_margin"
          android:paddingRight="@dimen/activity_horizontal_margin" &gt;
  
          &lt;TextView
          android:id="@+id/textView18"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="@string/placements"
          android:textSize="12sp" /&gt;
  
          &lt;TextView
          android:id="@+id/textView19"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_below="@+id/textView18"
          android:text="@string/EXTC"
          android:layout_marginTop="3dp" /&gt;
  
          &lt;TextView
          android:id="@+id/textView20"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_below="@+id/textView19"
          android:text="@string/IT"
          android:layout_marginTop="3dp" /&gt;
          &lt;/RelativeLayout&gt;
          &lt;/LinearLayout&gt;
  
          &lt;/ScrollView&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>