Bincy Baby Bincy Baby - 11 months ago 171
Android Question

ListView not expanding inside NestedScrollView

Am using Coordinator Layout in my activity page. In that there is ListView below the app bar. But its not working when i use ListView instead of NestedScrollView. And if i put ListView inside NestedScrollView, ListView is not expanding

Answer Source

For the CoordinatorLayout to work properly you need the scrolling child to implement NestedScrollingChild. Such classes are NestedScrollView and RecyclerView.

To say it short - just use a RecyclerView for your scrolling content and it'll work correctly :)

P.S. As a side note, I don't see a reason why you'd use a ListView anymore. I know it's a habit and it's easier to setup (because you've done it many times), but using a RecyclerView is the recommended way anyways.