Possible Duplicate:
Listview inside ScrollView is not scrolling on Android
I have a ListView
inside a ScrollView
and the problem is that the ScrollView
is scrolling but ListView
doesn't scroll. I think this is happening because of that ScrollView
. Does anyone have a solution for this issue?
You shouldn't nest a ListView inside a ScrollView.
If you're trying to scroll some other views along with the ListView, you might check out this answer.
I required having a listview inside a scrollview in order to prevent the entire screen from being extremely long. This allows you have to set the number of items displayed on the list, while the rest will be scrolled.
I use the following class in my app and so far it seems to work terrific.
Use the following method and enjoy!
listViewTouchAction is a global integer value. If you can replace the line
with something else please share it with us.
ListView
s have built-in scrolling capabilities. Encapsulate it in any other layout like aLinearLayout
orRelativeLayout
.