Change scrollbar position in Android RecyclerView

Hey, I was wondering if it is possible to reposition the scrollbar in Android RecyclerView. I would like to move the scroll bar closer to the right side of the display. If someone could just point me in the right direction, a link or something that I would really appreciate, because at the moment I can not find anything on this.

Thank!

+4
source share
1 answer

I have only one workaround,

you can add only upper and lower indents (or margins) to your main content.

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  xmlns:fab="http://schemas.android.com/apk/res-auto"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:paddingTop="4dp"
  android:paddingBottom="4dp">

Then a RecyclerView without defining styles, for example:

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

CardView , , , - , :

<android.support.v7.widget.CardView
  xmlns:card_view="http://schemas.android.com/apk/res-auto"
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_marginLeft="6dp"
  android:layout_marginStart="6dp"
  android:layout_marginRight="6dp"
  android:layout_marginEnd="6dp">
+2

All Articles