Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide RecyclerView scrollbar

How can I remove the scrollbar in my recyclerview? I've tried with mRecyclerView.setScrollBarSize(0); but it's not working. (Actually, it doesn't do anything, whatever the value I set).

like image 858
andrew Avatar asked Apr 01 '15 13:04

andrew


People also ask

How to remove scrollbar from RecyclerView android?

You can open or close it. Basically, you need to add android:overScrollMode=“never” line to your RecyclerView.

How can show all items in RecyclerView without scrolling?

In RecyclerView use android:nestedSrollingEnabled="false" and use NestedScrollView as a parent Scroll View.

How do I stop refreshing RecyclerView data scroll to top position android?

Make a setDataList method in your adapter class. And set your updated list to adapter list. And then every time of calling API set that list to setDataList and call adapter. notifyDataSetChanged() method of your adapter class.


1 Answers

Put android:scrollbars="none" like this:

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

Update for androidx library :

    <androidx.recyclerview.widget.RecyclerView         android:id="@+id/recyclerView"         android:layout_width="match_parent"         android:layout_height="match_parent"         android:scrollbars="none" >     </androidx.recyclerview.widget.RecyclerView> 
like image 147
Yousef Zakher Avatar answered Sep 27 '22 20:09

Yousef Zakher