What is the equivalent listview.setSelection in case of Recycler View

后端 未结 4 924
天命终不由人
天命终不由人 2021-01-01 09:17

In the case of a ListView if we want to make a particular item selected we use the setSelection method. How do we do this in case of Recycler

4条回答
  •  伪装坚强ぢ
    2021-01-01 09:42

    Use RecyclerView LayoutManager to scroll item at position

    recyclerView.getLayoutManager().scrollToPosition(position)

提交回复
热议问题