I have a recyclerview with padding top and bottom for 10dp.
And I add clipToPadding=false
like so:
<android.support.v7.widget.RecyclerView
android:id="@+id/contentView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingStart="@dimen/margin_medium"
android:paddingTop="@dimen/margin_medium"
android:paddingBottom="@dimen/margin_medium"
android:clipToPadding="false"
android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbars="vertical" />
I notice that my scrollbar will actually respect the top and bottom padding, and does not scroll the whole height.
Is there a way so that my scrollbar actually scrolls top and bottom completely?
You just need to add android:scrollbarStyle="outsideOverlay"
to your recyclerView.
ref - https://developer.android.com/reference/android/view/View.html#attr_android:scrollbarStyle
You can achieve similar scrollbar results with it.
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