Hi,
Is it possible to have a loop scrolling through a CollectionView for my mobile app (Android, iOS only)? Meaning after I reached the last element it would show me the first one again. Just like we know it from Netflix. I would like to avoid simply adding the same elements to the ItemSource and thus potentially increasing the ItemSource size infinitely.
I know CarouselView has a property called loop for that. But for our use case CarouselView was too buggy which is why I have to use CollectionView.
Any help is much appreciated.
Answers
I cannot found useful way to achieve it in xamarin.forms. but we have to achieve it by custom-renderer, I used this way in the xamarin.android to test it, but I cannot get the correct effect, and achieve custom -renderer for collectionview, it is hard to create adapter that same with the native Collectionview, Because xamarin,android's adapter do not provide any set method to change the value in adapter.
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.
Thank you very much for your reply! I already suspect that there I'd have to use a custom renderer. Any other ideas? Anybody who already implemented this?
https://forums.xamarin.com/discussion/180897/how-to-stop-loading-duplicate-item-in-listview-using-infinite-scroll
https://stackoverflow.com/questions/58366576/how-can-i-creat-endless-scrolling-in-xamarin
CollectionView also has Threshold property https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/collectionview/populate-data#load-data-incrementally
@igorkr_10 Thanks! Yes, I know these properties and this would work if I only wanted to have an infinite scrolling to the right (the collection view's orientation is horizontal as I am mocking a carousel). But I want to be able to scroll to both directions.
Jumping from element 1 to 10 (left scroll) and jumping from element 10 to 1 again (right scroll).
CarouselView
is a good choice for this needs.@LeonLu As mentioned in the text above I can unfortunately not use CarouselView. PeakAreaInsets has an iOS reported iOS bug. And we need to show bits of the next element.
Could you provide the github thread about CarouselView's issue in iOS?