How to detect that CollectionView's scroll hit the bottom? #29938
Unanswered
SergTomcat
asked this question in
Q&A
Replies: 1 comment 1 reply
-
A workaround would be to place the CollectionView in a ScrollView, then compare the ScrollView's ContentSize.Height with ScrollY+Height. Here's a ScrollView subclass that will simplify this. Just put your CollectionView inside MyScrollView and react to when public partial class MyScrollView : ScrollView
{
public bool IsAtEnd => ScrollY + Height >= ContentSize.Height;
public MyScrollView()
{
PropertyChanged += (s, e) =>
{
switch (e.PropertyName)
{
case nameof(ScrollView.ContentSize):
case nameof(ScrollView.Height):
case nameof(ScrollView.ScrollY):
OnPropertyChanged(nameof(IsAtEnd));
break;
}
};
}
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Inside ItemsViewScrolledEventArgs of Scrolled event I only see vertical delta and direction of current scroll.
I need to find out that scroll reached it's limit. I can use LastVisibleItemIndex, but it won't work when last item is bigger than screen. So I cannot use equality FirstVisibleItem and LastVisibleItem either because it doesn't tell if I'm looking at the start or at the end of an item.
How to find total scroll height so I could in theory calculate vertical delta + current height?
Beta Was this translation helpful? Give feedback.
All reactions