1

I am using a CarouselView and a Timer to have it make the changing effect every X seconds. Now as I am finding out there are a few bugs. ScrollTo doesn't really scroll the CarouselView to the position asked. Setting the Position property doesn't help neither. They will just scroll the position to higher or lower than the current position depending on the parameter sent.

Here is the C# for any testing:

Device.StartTimer(TimeSpan.FromSeconds(2), () =>
                {
                    slidePosition++;
                    if (slidePosition == (CarouselView1.ItemsSource as ObservableCollection<LinksHeaderTitles>).Count - 1)
                    {
                        for (int i = slidePosition - 2; i >= 0; i--)
                        {
                            CarouselView1.ScrollTo(0, animate: false);
                        }
                        slidePosition = 0;
                    }
                    CarouselView1.ScrollTo(slidePosition);
                    return true;
                });

Is there any better workaround to reseting the position to 0 after the last item was reached?

riQQ
  • 9,878
  • 7
  • 49
  • 66
Alejandro
  • 308
  • 2
  • 11

1 Answers1

0

You could have a try with ScrollToPosition.Start :

CarouselView1.ScrollTo(slidePosition, position: ScrollToPosition.Start);

Maybe it will show what your needs.

Junior Jiang
  • 12,430
  • 1
  • 10
  • 30