1

I want to add endless listView inside ScrollView but on ScrollChanged does not work

<ScrollView ..>
<EndlessListView ../>
</ScrollView>

Is there any way to do that?

Ahmed Mohammed
  • 337
  • 3
  • 16
  • You shouldn't put a `ListView` inside a `ScrollView` because the `ListView` class implements its own scrolling and it just doesn't receive gestures because they all are handled by the parent `ScrollView`. – Aspicas Oct 22 '15 at 09:07
  • In my opinion, when you need to put a list view inside a scroll view, then you should re-think your design. However, if there is no way to change that, check [previous similar attempts](https://www.google.com.eg/webhp?q=listview%20inside%20scrollview). – Ahmed Khalaf Oct 22 '15 at 09:09
  • @Aspicas Thanks in advanceو I know, I want any way to solve it. – Ahmed Mohammed Oct 22 '15 at 09:23
  • @AhmedKhalaf Thanks in advance, But It is necessary to add list inside scroll . – Ahmed Mohammed Oct 22 '15 at 09:24
  • @AhmedMohammed Check this. http://stackoverflow.com/a/19311197/715593 – Ahmed Khalaf Oct 22 '15 at 12:46
  • Did You achieve to do this, if yes can you help me? – E.Lahu Jan 12 '21 at 12:54

1 Answers1

0

If you want to put a listview in a scrollview, you have to re-implement a passive listview that does not handle its scroll.
You'll have to check for children size and visibility, and do the recycling stuff yourself.

I did it, it is possible, but you should not go this way.

Jfreu
  • 511
  • 5
  • 10
  • I did a passive listview that does not handle its scroll, i made the height of listView is the collect of height of all its children, the problem in endless scroll. Can I check if scrollView at bottom? – Ahmed Mohammed Oct 22 '15 at 09:29
  • What do you mean by endless scroll ? Is the list endless or the other content of the scrollview (below the list)? – Jfreu Oct 22 '15 at 09:37
  • The height of the custom view depends on what is inside, if the content changes, it is recalculated. This is how i do: i add the data, notify the adapter then the whole view adjusts itself depending on its content, and its visible children. – Jfreu Oct 22 '15 at 12:25
  • Would it be possible for you to share the code Jfreu :) ? – Benoit Oct 26 '15 at 09:30