RecyclerView not scrolling to the bottom

无人久伴 提交于 2019-12-05 05:03:19
Reprator

You can use these lines to scroll recyclerview to:

list.add(0, group);
adapter.notifyItemInserted(0);
recyclerview.scrollToPosition(0);
Mehul Goel

Thanks to everyone who responded, but turns out the problem was the version of RecyclerView I was compiling.

Previously I was compiling this

compile 'com.android.support:recyclerview-v7:22.0.0'

But I changed it to this and it worked

compile 'com.android.support:recyclerview-v7:22.2.0'

Credits to @roi divon for the answer: CoordinatorLayout with RecyclerView & CollapsingToolbarLayout

Maybe adding these lines to the recyclerView will do:

android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbars="vertical"

This is my recyclerView which is working:

<android.support.v7.widget.RecyclerView
            android:id="@+id/menuRecycler"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:scrollbarAlwaysDrawVerticalTrack="true"
            android:scrollbars="vertical"/>

I am not sure but I think problem might be Framelayout You can try with Linearlayout instead of Framelayout in your xml layout for the recyclerview items

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!