ListView Fast Scrolling on Android

Download Sample Download the sample

This Android platform-specific is used to enable fast scrolling through data in a ListView. It's consumed in XAML by setting the ListView.IsFastScrollEnabled attached property to a boolean value:

<ContentPage ...
    <StackLayout Margin="20">
        <ListView ItemsSource="{Binding GroupedEmployees}"
                  GroupDisplayBinding="{Binding Key}"

Alternatively, it can be consumed from C# using the fluent API:

using Xamarin.Forms.PlatformConfiguration;
using Xamarin.Forms.PlatformConfiguration.AndroidSpecific;

var listView = new Xamarin.Forms.ListView { IsGroupingEnabled = true, ... };
listView.SetBinding(ItemsView<Cell>.ItemsSourceProperty, "GroupedEmployees");
listView.GroupDisplayBinding = new Binding("Key");

The ListView.On<Android> method specifies that this platform-specific will only run on Android. The ListView.SetIsFastScrollEnabled method, in the Xamarin.Forms.PlatformConfiguration.AndroidSpecific namespace, is used to enable fast scrolling through data in a ListView. In addition, the SetIsFastScrollEnabled method can be used to toggle fast scrolling by calling the IsFastScrollEnabled method to return whether fast scrolling is enabled:


The result is that fast scrolling through data in a ListView can be enabled, which changes the size of the scroll thumb:

ListView FastScroll Platform-Specific