ScrollTo in ListViews, Xamarin.Forms 1.3

By December 24, 2014 Xamarin 3 Comments
Scroll to bottom

Xamarin.Forms 1.3 has been released!  Great news.

Today we tackle another new feature in 1.3: ScrollTo.  This allows us to scroll to the beginning of a ListView or to the end or to a particular entry.  Let’s return to the grouping code we created here.  We’re going to make some minor changes to illustrate ScrollTo

To illustrate how this works, let’s add a button to the XAML which will trigger the scrolling,

The event handler is identified as GoToLastItem.  We’ll implement that in our code behind,

The second parameter is an enumerated constant,

Enumeration

Enumerated Scroll Positions

 

 

 

 

 

The astute reader will notice that we set our ScrollToPosition enumerated value to Start to cause the list to the end.  I can only assume this is a bug in ScrollTo, but I will update this once I find out what is wrong.

Scroll to bottom

Scroll to bottom of list

 

 

 

 

 

 

 

 

 

 

In a future column I will illustrate how to scroll within groups and how to find a particular item in your ListView.

 

The following two tabs change content below.

Jesse Liberty

Director of Technology Development at Falafel Software
Jesse Liberty is Director of Technical Development for Falafel Software, an author and he creates courses for Pluralsight . He is a Microsoft MVP, a Xamarin MVP and a Certified Xamarin Mobile Developer. Liberty hosts the popular Yet Another Podcast and his blog is considered required reading. He was a Senior Evangelist for Microsoft, Distinguished Software Engineer at AT&T; Software Architect for PBS and Vice President of Information Technology at Citibank.

Latest posts by Jesse Liberty (see all)