ListView.ScrollTo does not work correctly when the HasUnevenRows property is true.

Jin-WookChungJin-WookChung USMember ✭✭

I'm struggling to scroll to a certain item using the ListView control, but as described at the bug 28277, the ScrollTo method does not work correctly because the ListView.HasUnevenRows property as true causes various cell sizes.

There is a way to address this issue before the bug is fixed officially?

Tagged:

Answers

  • DominikGradziDominikGradzi USMember

    I had a special use case where I needed to scroll to the bottom. Adding a timer and calling ListView.ScrollTo again worked for me. Don't know how well it works with none edge items.

    var scrollto = MyList [MyList.Count - 1];
    listView.ScrollTo (scrollto, ScrollToPosition.End, false);
    
    
    Device.StartTimer(TimeSpan.FromMilliseconds(25),()=>{
        listView.ScrollTo(scrollto,ScrollToPosition.End,false);
        return false;
    });
    
  • BalakrishnanSBalakrishnanS USMember ✭✭

    Seems like it is a bug with Xamarin.forms.

    https://bugzilla.xamarin.com/show_bug.cgi?id=28277#c6

    I am also facing the same Issue and looking for the solution.

  • RaymondKellyRaymondKelly USMember ✭✭✭

    Same here, I get what appears to be a screen jump when calling scrollto with uneven rows.

  • KarineROBINOTKarineROBINOT USMember

    @BalakrishnanS Do you find a solution ? I'm facing the same problem.

    The timer works but the scroll doesn't go at the end
    this.MessagesListView.ScrollTo(vm.Messages.LastOrDefault(), ScrollToPosition.End, false);

  • AdrianKnightAdrianKnight USMember ✭✭✭✭

    The timer does not work for me in the way I want. This is a dirty trick. We need a real fix.

  • JimTyminskiJimTyminski USUniversity ✭✭

    @Jin-WookChung said:
    I'm struggling to scroll to a certain item using the ListView control, but as described at the bug 28277, the ScrollTo method does not work correctly because the ListView.HasUnevenRows property as true causes various cell sizes.

    There is a way to address this issue before the bug is fixed officially?

    This worked for me - but this needs to be fixed! This has been a bug since 2000 BC!

  • VovaKamishnikovVovaKamishnikov USMember ✭✭✭
    edited October 2018

    del

  • jonathannicholsjonathannichols USMember ✭✭

    What is the fix for this?

Sign In or Register to comment.