0

I have read the all the answers here:How can I put a ListView into a ScrollView without it collapsing?But it seems no one cares why the ListView get collapsed when put in a ScrollView.I think something happens to the onMeasure() method but I'm not sure of it.So,does anyone have any idea?

Community
  • 1
  • 1
alphacat2018
  • 178
  • 2
  • 8

2 Answers2

1

Your aproach is not very good. As you did't describe your situation, i can't say exactly what you need. But anyway i will suggest to use Headers and footers instead of puttings scrollable listView in ScrollView. But if you need that anyway, i suggest to use RecyclerView and NestedScrollView instead, as it handles a lot of scrolling issues.

RecyclerView

NestedScrollView

Arsen Sench
  • 440
  • 3
  • 18
0

Android doesn't support putting scrollable UI component as a child to other scrolable UI component. Since ListView is scrollable by default, that might be the problem. Hence, all the suggestions not to use ListView as a child to ScrollView

Zozinski
  • 63
  • 8