It's sometimes necessary to know when ListView has been scrolled.
Many people have been asking for such an event, and a quick web search for 'xamarin forms listview scroll event' shows it. Many answers suggest using on ItemAppearing
and ItemDisappearing
which is not a good implementation. I think a good solution requires having a renderer 😱. This proposal should remove the need for (another) renderer.
New event on ListView:
public event EventHandler<Xamarin.Forms.ScrolledEventArgs> Scrolled;
this is exact same signature of ScrollView.Scrolled event .
New feature, so it does not have any impact.
Hmmm...
I would like to know the dynamic position of a ListView as I would like to add animation features to my app. For example you often see the header on a page shrink as a list is scrolled. That would require a realtime position update. This sounds like an event only when the scroll has completed.
Could you please Change the title to "Add Scrolled event to CollectionView "?
Because they are working on it, and collectionView need this enhancement to make
parallax headers, or other stuff..
Regards,
Does this issue also include implementing RemainingItemsThreshold and RemainingItemsThresholdReached as per the spec in #3172 ?
It is not available on the CollectionView control XAML in 4.0.0.169046-pre6.
@andreinitescu While I agree what you are proposing is needed and support it, I'm curious to know why you think using ItemAppearing
is not a good implementation. Could you please elaborate?
To make parallax headers, make some views resizing, dis/appearing when scroll up/down or other stuff using the scroll event.
With ItemAppearing, you have to indexing your cells and check if it'a appearing on top or bottom, just to know the scroll direction only.
It's a workaround but not a good implementation to get the scoll direction.
@FunkyLambda with ItemAppearing you doesn't have a continuous feedback to know exactly how much the user has scrolled. You have to wait until an item appear and suppose you want to fade an element while the user is scrolling based in the distance and direction. It's hard to get a correct implementation and things get messy when the items in a listview doesn't have the same height.
@jlzapata Makes sense.
Hi all, please check #7157
Most helpful comment
Could you please Change the title to "Add Scrolled event to CollectionView "?
Because they are working on it, and collectionView need this enhancement to make
parallax headers, or other stuff..
Regards,
3172