ListView: Endless scroll #13043
m1ga
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Simple endless scroll using a ListView
For demo purposes I've used https://designer.mocky.io/design to create an API endpoint that just returns an image url, title and text. Images are fetched from http://lorempixel.com/ (a bit slow 😄 ).
What it does
The ListView will fetch an initial set of 30 elements and adds a marker at position 10. When the marker is reached during scrolling it will start a new API call and appends that data. If you scroll really fast you'll see a tiny break at the bottom depending on your API. But you can adjust the return size and the marker position to make a better experience. Of course you don't want to do it to quickly to save bandwidth.
Code
index.js
index.xml
index.tss
Beta Was this translation helpful? Give feedback.
All reactions