我想在设置适配器时设置回收器视图的垂直位置。事实证明这比我想象的要困难得多。以下是相关代码:
adapter = new MyAdapter(getActivity(),provider.getItems(),analyticsHandler, null);
myRecyclerView.setAdapter(adapter);
myRecyclerView.invalidate();
if (pos < adapter.getItemCount()) {
myRecyclerView.getLayoutManager().scrollToPosition(pos);
}