I used custom listview . Content comes from dynamic I want to same listview height same as content.
I used wrap_content but this does not help If I remove scrollview then its work
Code. "The vertically scrolling ScrollView should not contain another vertically scrolling widget (ListView)"
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background_img"
android:scrollbars="none" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ListView
android:id="@+id/lstsemtrack"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:divider="#f2e4e4"
android:dividerHeight="1dip"
>
</ListView>
Item list
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="10dip"
android:scrollbars="none" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="4" >
<TextView
android:id="@+id/txtBiology"
style="@style/sem_rowtext"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginRight="5dip"
android:layout_weight="1"
android:text="Biology" />
<TextView
android:id="@+id/txtClass"
style="@style/sem_rowtext"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Biology - 101" />
<TextView
android:id="@+id/txtGrade"
style="@style/sem_rowtext"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Grade" />
<TextView
android:id="@+id/txtGrade"
style="@style/sem_rowtext"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Remove" />
</LinearLayout>
</LinearLayout>
output like below I want same as content no scrollview