I have the following question: I have a difficult layout that contain ListView. I need disable scrolling ability for ListView, because it's container (root Layout) have had ScrollView already, and I don't need a scrolls for ListView. I disable scrolls by android:scrollbars="none", but abilitity for scrolling would stay. I need that if ListView has 10 items that all items will be shown. How can I do it?
2 Answers
Can't you just use a LinearLayout with 10 elements instead of the ListView? It is not a good idea to have a ScrollView in another ScrollView.
4 Comments
user1023177
It is good solution, but I need to divide items by "divider" like divider of ListView, but I don't know how to use it on LinearLayout.
AdamVe
Divider height can be done by margin or padding (top, bottom). Self divider can be replaced by an empty view with the drawable set on it? You could have this divider view between all the elements.
David Snabel-Caunt
Indeed, a ListView inside a ScrollView is a bad idea
Timmmm
A
ListView has many more features than a ScrollView (item selection, etc.), so this is not a great solution. I think a better solution would be to copy the ListView code to your own class and remove all the stuff relating to scrolling.