Xamarin 101: How to use Continuous or Infinite Scrolling in Xamarin Forms
Are you looking for samples on how to implement continuous scrolling of your ListView?
Do you know that there’s a NuGet package that can help you create Infinite Scrolling of ListView?
In this post, we will create a sample app that has infinite scrolling of ListView.
The first step is to right-click on your Solution. Then go to Manage NuGet Packages for Solution.
On the browse tab, type Xamarin.Forms.Extended.InfiniteScrolling. Download the NuGet package by Matthew Leibowitz.
Then install on each project in your solution.
Create a MainViewModel then create an instance of InfiniteScrollCollection in your constructor. Copy the login that you see in the screenshot below.
Add the xmlns namespace of InfiniteScrolling library.
Add the InfiniteScroll View in your XAML file. This needs to be located in your ListView.Behaviours
Next is creating a Loading text. This will be located in the ListView.Footer.
Build and deploy your solution.
As you can see on the GIF that the application does not load all the elements of the ListView in a single load. The elements are showing batch by batch.
So give it a go and let me know if it works.
Here’s the link to my GitHub repository: https://github.com/webmasterdevlin/InfiniteScrollingDemo
Until next time. Happy coding.