Smooth scroll to position when ListView SelectedItem changed

VelocityVelocity NZMember ✭✭✭

Summary

Automatically scroll the ListView to the selected position when SelectedItem property is changed.
Works on iOS, but not implemented on Android or UWP.

API Changes

Update ListView renderers for Android and UWP.
We have already built this functionality using custom renderers. If approved, can create a PR.

Intended Use Case

Unify the UI behaviour across all three platforms.

Tagged:

Open · Last Updated

Posts

  • IrrealIrreal RSUniversity ✭✭✭

    This sounds like a good proposal.
    Unfortunately the "Like" option to vote on posts still doesn't seem to work, so here is a whole post just to say "I like this"

  • SamanthaHoutsSamanthaHouts USXamarin Team Xamurai

    @Velocity: Does your implementation work well (i.e., scroll is actually smooth and doesn't jump around) with uneven rows without a defined RowHeight? RecycleElement/RetainElement? What happens if you add and remove rows?

  • VelocityVelocity NZMember ✭✭✭

    @SamanthaHouts said:
    @Velocity: Does your implementation work well (i.e., scroll is actually smooth and doesn't jump around) with uneven rows without a defined RowHeight? RecycleElement/RetainElement? What happens if you add and remove rows?

    Good questions. Yes, scroll is actually smooth and doesn't jump around. We have tested with both RecycleElement/RetailElement, but haven't tested with adding/removing rows.

    Let me put together a sample project with the necessary functionality and report back to you on this.

  • abraabra ADMember ✭✭✭

    Any news about when this feature will be available ?

  • VelocityVelocity NZMember ✭✭✭

    @abra Given this proposal hasn't been accepted, there is currently no ETA on this.
    However if you are interested on how to do it, PM me.

  • mjdevelopermjdeveloper Member ✭✭

    It is late, but useful to others
    YourListView.ScrollTo(YourListView.SelectedItem, ScrollToPosition.Center, true);

Sign In or Register to comment.