If your RecyclerView list item parent has "wrap_content" property, Recyclerview calculates the heights again and scrolls top.
There are two solutions:
- Set your height a constant value like this:
layout_height="100dp"
Use StaggeredGridLayoutManager like this:
mRecyclerView.setLayoutManager(new StaggeredGridLayoutManager(1, StaggeredGridLayoutManager.VERTICAL));
The second solution is more efficient and I suggest this one
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…