I am trying to avoid the overscroll shadow on the RecyclerView
. However, it seems that adding android:overScrollMode="never"
has the side effect of hiding any vertical and horizontal scrollbars that were present in the RecyclerView
. Does anyone know how to have scrollbars showing while avoiding the overscroll shadows?
Just to make the answer complete:
RecyclerView doesn't draw scrollbars due to willnotdraw flag. This flag is set to true, when neither the background nor the edge effects (overScrollMode="never"
) are there. It's a drawing code optimisation for layouts. It should also be affected by the state of either of the scrollbars.
To fix it properly without setting the background you have to call setWillNotDraw(false)
I'm not sure that my answer will be correct, but i had the same problem with visability of scrollbars in RecyclerView
. And it wasn't caused by android:overScrollMode
property.
In my case the reason was that scollbars of RecyclerView
doesn't work properly on some old devices if the android:background
property is not set. Try to set it to any color or to transparent
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