How can I change the color of my scrollbar in a recyclerView?
I have the scrollbar but I want to change its color. My recyclerView is like this:
<android.support.v7.widget.RecyclerView android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/recyclerView" android:layout_below="@id/my_toolbar" android:layout_above="@+id/progressBar" android:scrollbars="vertical" />
You can do this by including following line of code in your Recyclerview
android:scrollbarThumbVertical="@drawable/yoursdrawablefile
The drawable file in my case is:
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <gradient android:startColor="#000" android:endColor="#000" android:angle="45"/> <corners android:radius="6dp" /> </shape>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With