Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android: listview inside a scrollView doesn't work?

I am having a listview inside a scrollview, but the problem is that the scrollview is scrolling but listview is not scrolling. I think this is due to that scrollView.

Can somebody who has a working solution post it here as reference?

like image 860
Sachin Gurnani Avatar asked Jul 27 '26 04:07

Sachin Gurnani


1 Answers

Generally, you cannot put scrollable things inside other scrollable things, where they scroll in the same direction, and have the results be reliable. Occasionally this works (e.g., WebViews in a ViewPager), but that is the exception, not the norm.

Either:

  • Move the ListView out of the ScrollView, or

  • Move all the rest of the contents of the ScrollView into the ListView, whether using things like addHeaderView() or my MergeAdapter

like image 141
CommonsWare Avatar answered Jul 29 '26 22:07

CommonsWare



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!