I found many tutorials and examples butWhy ListView cannot be used in a ScrollView?
Only answers is Using a ListView to make it not scroll is extremely expensive and goes against the whole purpose of ListView. resources.
I have following xml file.
.........
<ScrollView
android:id="@+id/sv"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/textView2">
<ListView
android:id="@+id/list"
android:layout_width="275dp"
android:layout_height="200dp">
</ListView>
</ScrollView>
.........
In this xml file, i have already use
wrap_content instead of 200dp height of listview
ListView lv = (ListView) findViewById(R.id.list);
lv.setAdapter(new EfficientAdapter(this));
but doesnot work.
What is the alternative scrolling list item for specific height and weight.
But I have try this:
<ListView
android:id="@+id/list"
android:layout_width="275dp"
android:layout_height="200dp">
</ListView>
or
<ScrollView android:layout_width="fill_parent" android:id="@+id/sv"
android:layout_height="wrap_content" android:layout_below="@+id/textView2">
<LinearLayout android:layout_width="fill_parent"
android:orientation="vertical"
android:layout_height="wrap_content">
<ListView android:id="@+id/list" android:layout_width="275dp"
android:layout_height="240dp"></ListView>
</LinearLayout>
</ScrollView>
Without scollview but scrolling the listitem is ok but quite not smothly. I have try this but could not get more idea behind this.
Edited:
Is it right Listview have inbuild scrolling capabilities. So not necessary to define listview inside the scrollview. It means scrollview in not necessary?