Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OnScroll Event in ListView using Xamarin Forms

I have a listView and when the receive a message, the listview should scroll to the end only, if it already in the end.

To make it clear, if the user is seeing old message, the listview shouldn't scroll to the end automatically, but if the is already on the on the listview when receiving a message the listview should automatically scroll to the end.

So I have to get the actual position of the ListView, I didn't see any property or method similar to get this position on the API.

So I was thinking if is possible to override an event like OnScroll, so I can save the current position of the ListView without using custom render.

This can be done using XamarinForms?

like image 383
Guilherme Torres Castro Avatar asked Jun 05 '15 17:06

Guilherme Torres Castro


1 Answers

ListView doesn't fire Scrolled events like ScrollView does, but it does fire ItemAppearing and ItemDisappearingevents that you may be able to use to keep track of which items are currently visible.

like image 126
Joel Anair Avatar answered Oct 14 '22 03:10

Joel Anair