As we have seen, RecyclerView is more efficient than ListView, so I prefer to use it in my project. But lately, I ran into a problem when I put it in my own ViewGroup. RecyclerView easily set scrollbars in xml as follows:
<android.support.v7.widget.RecyclerView android:id="@+id/recycler_view" android:scrollbars="vertical" android:layout_width="match_parent" android:layout_height="match_parent" />
But I really cannot find any method for setting scrollbars in the code for RecyclerView, which I tried:
mRecyclerView.setVerticalScrollBarEnabled(true);
and then I saw this one in an Android document.
So, I tried to create my own LayoutManager and override the functions that I thought I needed. But in the end I failed. So can anyone tell me how to make my own LayoutManager or just show me another solution. Thank!
android scrollbars android-recyclerview
Kevin Liu Nov 21 '14 at 7:39 2014-11-21 07:39
source share