read

Those of you who have played around with ListViews in Xamarin.Android are probably familiar with the FastScroll and SectionIndexer features.  They essentially make it really easy for users to navigate long lists by providing them with a little “handle” to quickly drag through lists, and with the SectionIndexer it also gives them a nice little popup showing where they are up to in the list.

Unfortunately, this feature isn’t available in Xamarin.Forms ListViews running on Android.

Well, it actually turns out is available through an Android Platform-Specific by the name of SetIsFastScrollEnabled.

And it’s dead simple to use, just with a single line of code:

listView.On<Android>().SetIsFastScrollEnabled(true);

Once you add that code, you will get the FastScroll thumb, but as a super-duper bonus if your ListView is grouped then you also get the SectionIndexer. So now your Xamarin.Forms lists can look like this:

Note: One thing to be aware of, in order for the FastScroll thumb to be visible, you will have to have a sufficiently large number of rows in your ListView (about 3 times as many rows as you have screen real estate for).

Further reading:

So I hope that helps, and Happy Coding!

Kym

Mobile, Xamarin, Windows Store Apps, Agile -- I love 'em all! Check out more


Published on

Show Comments
  1. Mike Foden says:

    That’s pretty nifty. Amazing how little tweaks for platform specific functionality can take an app to the next level!


Leave a Reply

Your email address will not be published. Required fields are marked *

Kym Phillpotts

I write about Xamarin Forms, mobile development or whatever else I might be concentrating on.

Back to Home