In a ListView
, getListView().setSelection(n);
is used for a direct scroll and getListView().smoothScrollToPosition(n);
is used for a smooth scroll.
Is this possible in a RecyclerView
?
In a ListView
, getListView().setSelection(n);
is used for a direct scroll and getListView().smoothScrollToPosition(n);
is used for a smooth scroll.
Is this possible in a RecyclerView
?
You'll have to use scrollToPositionWithOffset.
//Scroll item 2 to 20 pixels from the top
linearLayoutManager.scrollToPositionWithOffset(2, 20);
This question was answered before.