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.

 

Step 1:

The first step is to right-click on your Solution. Then go to Manage NuGet Packages for Solution.

 

Step 2:

On the browse tab, type Xamarin.Forms.Extended.InfiniteScrolling. Download the NuGet package by Matthew Leibowitz.

 

Step 3:

Then install on each project in your solution.

 

Step 4:

Create a MainViewModel then create an instance of InfiniteScrollCollection in your constructor. Copy the login that you see in the screenshot below.

 

Step 5:

Add the xmlns namespace of InfiniteScrolling library.

 

Step 6:

Add the InfiniteScroll View in your XAML file. This needs to be located in your ListView.Behaviours

 

Step 7:

Next is creating a Loading text. This will be located in the ListView.Footer.

 

Step 8:

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.

Post A Comment