Forum Xamarin Xamarin.Android

Button SrollUp/Down for ListView

I have a list view and two buttons that will be one scrollUp and scrolldown for listview, but I'm not managing to implement this function.

I used MainList.SetSelection (MainList.Count - 1), but he sends straight to the end of the list, would make a scrolldown one item at a time.


  • ChrisHonselaarChrisHonselaar NLBeta ✭✭✭

    MainList.Count - 1 means the last item in the list, so that's where you go :)

    Instead you should use MainList.LastVisiblePosition, and use that in MainList.SetSelectionFromTop() or MainList.SmoothScrollToPosition(), to scroll down one screen.

    You can do something similar to scroll up (combining this with FirstVisiblePosition).

Sign In or Register to comment.