ChatGPT解决这个技术问题 Extra ChatGPT

Remove RecyclerView scroll effects

I have two RecyclerView inside my NavigationDrawer. Both have the blue scroll effects.

How can I remove this effect in both RecyclerViews?

I tried changing: mRecyclerView.setHasFixedSize(true); to false, but it remove scroll effects. (What is the effect of this method?)

https://i.stack.imgur.com/IvfHV.png


m
mmlooloo

Add this to your layout:

android:overScrollMode="never"

So:

<android.support.v7.widget.RecyclerView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:overScrollMode="never"
    android:background="#FFFFFF"
    android:scrollbars="vertical" />

only problem with this is that the fadingEdge option is disabled
There are also value "ifContentScrolls", if you want to show effect, when list is longer than view
wow man it so useful very very thank you for your help....
This is the correct answer 100%
A
Algar

And in Java you would do

recyclerView.setOverScrollMode(View.OVER_SCROLL_NEVER)

or in Kotlin

recyclerView.overScrollMode = View.OVER_SCROLL_NEVER