Issue
i am using a CarouselView to display certain pages.
The collection is defined like this.
public IList<View> Pages { get; } = new ObservableCollection<View>();
The binding looks as follows in the xaml code.
<CarouselView x:Name="PageCarousel" ItemsSource="{Binding Source={x:Reference PagePanelView}, Path=Pages}" IndicatorView="PageCarouselIndicator" Loop="False" VerticalOptions="FillAndExpand" IsScrollAnimated="False">
The user can trigger a refresh with a button. The refresh logic just calls a Pages.Clear() and adds them again. For keeping the current position i use the ScrollTo(int index).
Unfortunately this does not work as expected, because the CarouselView shows always the first page after refreshing.
Xamarin.Forms version is 5.0.0.2083.
Thanks.
Solution
Calling the ScrollTo with animate: true instead of false seems to fix the issue.
Answered By - Tobias S
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.