Stop scrolling in a listview

后端 未结 6 2377
挽巷
挽巷 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

    Use

    listView.smoothScrollBy(0, 0); // to stop the scrolling.
    // followed by
    listView.setSelection(position) // to move to the specific position.
    

提交回复
热议问题