Hello,
Welcome to our Microsoft Q&A platform!
Yes, it is just the case as you said. We can scroll an item at an index into view or Scroll an item into view.
And we can detect scrolling and get the HorizontalOffset
and VerticalOffset
by using the following event:
<CollectionView Scrolled="OnCollectionViewScrolled">
...
</CollectionView>
void OnCollectionViewScrolled(object sender, ItemsViewScrolledEventArgs e)
{
Debug.WriteLine("HorizontalDelta: " + e.HorizontalDelta);
Debug.WriteLine("VerticalDelta: " + e.VerticalDelta);
Debug.WriteLine("HorizontalOffset: " + e.HorizontalOffset);
Debug.WriteLine("VerticalOffset: " + e.VerticalOffset);
Debug.WriteLine("FirstVisibleItemIndex: " + e.FirstVisibleItemIndex);
Debug.WriteLine("CenterItemIndex: " + e.CenterItemIndex);
Debug.WriteLine("LastVisibleItemIndex: " + e.LastVisibleItemIndex);
}
If you want to scroll to exact position , you can create an issue here: https://github.com/xamarin/xamarin-forms-samples/issues
Best Regards,
Jessie Zhang
---
<font color="grey">Xamarin forums are migrating to a new home on Microsoft Q&A!
We invite you to post new questions in the Xamarin forums’ new home on Microsoft Q&A!
For more information, please refer to this sticky post.</font>