Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

iOS - ListView ScrollTo animation is jarring

$
0
0

I picked the DataTemplateSelector tutorial and changed it to scroll to bottom when a message is sent.

It does scroll to the end, but it seems that its not scrolling from the current position. It seems that it jumps up some entries then scrolls to the end.

I saw the #28277 bug report, but this issue is different. It scrolls to the end of the list but the animation is jarring.

Check the changes I made:

public partial class MainPage : ContentPage
{
    MainPageViewModel vm;

    public MainPage()
    {
        InitializeComponent();
        Title = "Monkey Chat";
        vm = new MainPageViewModel();
        BindingContext = vm;

        vm.Messages.CollectionChanged += Messages_CollectionChanged;
    }

// ...

    void Messages_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
    {
    MessagesListView.ScrollTo(MessagesListView.ItemsSource.Cast<object>().LastOrDefault(), ScrollToPosition.End, true);
    }
}

I attached the project so you can check it out.


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>