CollectionView: Item indices in the Scrolled event args (ItemsViewScrolledEventArgs) are incorrect on iOS when IsGrouped = true

Евгений Егорычев 6 Reputation points
2021-07-25T18:28:53.983+00:00

When a CollectionView's IsGrouped property is set to true, the values of FirstVisibleItemIndex, CenterItemIndex, and LastVisibleItemIndex specified in the ItemsViewScrolledEventArgs passed to the Scrolled event handler are incorrect. They appear to be unable to reflect the indicies of any items beyond the first group.

This issue has already been raised in various forums before, but no solution has been found.

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,355 questions
{count} votes

1 answer

Sort by: Most helpful
  1. JarvanZhang 23,961 Reputation points
    2021-07-26T06:19:04.91+00:00

    Hello,​

    Welcome to our Microsoft Q&A platform!

    the values of FirstVisibleItemIndex ... specified in the ItemsViewScrolledEventArgs passed to the Scrolled event handler are incorrect

    I tested the function with the lastest Xamarin.Forms and reproduced the issue on my side. Someone faced the simialr issue on previous version and has reported it to the Xamarin.Forms github repo. You could add your problem to the topic. Here is the link: https://github.com/xamarin/Xamarin.Forms/issues/10389

    Best Regards,

    Jarvan Zhang


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.