I've got a RecyclerView
and would like to have scrollbar showing, when it covers more than one page.
I get no scrollbar at all. Any idea?
My layout:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<CheckBox
android:id="@+id/cl_only_empty"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="5dp"
android:text="@string/cl_only_empty"
android:textColor="@color/white" />
<android.support.v7.widget.RecyclerView
android:id="@+id/callsList"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical" />
</LinearLayout>
If you are fine to set ScrollBar programmatically, then you can use
ContextThemeWrapper
. First you need to define styling in Style.xml file:And then apply styling when you initialize your RecylerView:
use recyclerView as below in xml layout
and add below code for scrollview in java, it will be okay
Add the code to Recycler view xml to make scroll bar visible.
Use android:scrollbars attribute "vertical" and android:scrollbarThumbVertical attribute to set the color and android:scrollbarSize attribute to specifiy size:
Scroller can be set to recyclerview on multiple ways. 1st you can simply add scrollbar in xml and set its property android:fadeScrollbars="false" to always show it.
Or you can make a style theme and use it programitically when initializing recyclerview
thanks
You can use from :
Scrollbar Link