Stop scrolling in a listview

后端 未结 6 2380
挽巷
挽巷 2021-02-15 16:32

I have in my activity a listview and an imagebutton. When I click the imagebutton I want to go to a specific position in the list (I do this by calling: setSelection(int positio

6条回答
  •  日久生厌
    2021-02-15 17:12

    I would try calling ListView.smoothScrollToPosition(int position) to scroll back to the right position. As all the gui stuff is done in one thread I think there's little chance to really stop the scrolling on button press, so the easiest would be scrolling back (which might even be a nice gui effect too).

提交回复
热议问题