Recyclerview cannot be scrolled?

recyclerview not scrolling
recyclerview scrolling issue
recyclerview not scrolling to bottom
recyclerview not scrolling in constraint layout
recyclerview inside bottomsheet not scrolling
recyclerview inside recyclerview not scrolling
recyclerview inside nestedscrollview not scrolling
recyclerview disable scroll

I have this screen.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="5dp">

    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">

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

    </RelativeLayout>

    <Button
        android:id="@+id/btn_sync"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:onClick="DoUpload"
        android:text="Sync with server"
        />
</LinearLayout>

It looks like this (which is OK):

So I add more datas, now it looks like this:

The RecyclerView cannot be scrolled, and the button is hidden. How to fix this?

    <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="5dp">
<LinearLayout 
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">
     <android.support.v7.widget.RecyclerView
            android:id="@+id/my_recycler_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:scrollbars="vertical"
            android:layout_weight="1"/>
    <Button
        android:id="@+id/btn_sync"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:layout_gravity="center_horizontal"
        android:onClick="DoUpload"
        android:text="Sync with server"/>
    </LinearLayout >
</LinearLayout>

just copy this code and use it will be working fine

RecyclerView Scrolling Issue with NestedScrollView, Although RecyclerView has a very good and smooth scrolling built-in, but when you put into any ScrollView, then your RecyclerView's scrolling  "RecyclerView does not support scrolling to an absolute position. Use scrollToPosition instead" The RecyclerView(s) will be scrolled when the user taps/clicks (which should bring it into view) or when the user scrolls it manually (swipe, slide, scroll, whatever you want to call it).

I have edited the code for you this will solve the problem and button will be at the end of RecyclerView    
<?xml version="1.0" encoding="utf-8"?>
        <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical"
            android:padding="5dp">

            <RelativeLayout
                android:layout_width="wrap_content"
                android:layout_height="match_parent">

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

                <Button
                    android:id="@+id/btn_sync"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_below="@+id/my_recycler_view"
                    android:layout_gravity="center_horizontal"
                    android:onClick="DoUpload"
                    android:text="Sync with server" />
            </RelativeLayout>


        </LinearLayout>

RecyclerView within NestedScrollView Scrolling Issue, As we already know that recyclerView has a smooth scrolling by itself but when we need to put recyclerView within any scrollView it will not work like the below  Scrolling RecyclerView – Part 1 February 20, 2015 February 8, 2015 Mark Allison 8 Comments In this series of articles we’ll take a look in to scrolling behaviour of RecyclerView , and discover some oddities that may crop up, and some options for fixing them.

Try this,

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="5dp">

    <RelativeLayout
        android:layout_above="@id/btn_sync"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

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

    </RelativeLayout>

    <Button
        android:id="@+id/btn_sync"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:onClick="DoUpload"
        android:text="Sync with server"
        android:layout_alignParentBottom="true"
        />
</RelativeLayout>

Can't scroll RecyclerView to bottom · Issue #884 · umano , I have an Activity, inside which a Controller with ViewPager, where other Controller gets added. In this last Controller I have a RecyclerView:  As we already know that recyclerView has a smooth scrolling by itself but when we need to put recyclerView within any scrollView it will not work like the below code snippet: The solution for this is…

Try using constraint layout like below

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:padding="5dp">


    <android.support.v7.widget.RecyclerView
        android:id="@+id/my_recycler_view"
        android:layout_width="0dp"
        android:layout_height="0dp"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toTopOf="@id/btn_sync"
        android:scrollbars="vertical" />


    <Button
        android:id="@+id/btn_sync"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        android:onClick="DoUpload"
        android:text="Sync with server" />


</android.support.constraint.ConstraintLayout>

This layout should keep the button from hiding and recyclerview will scroll when more data items are added.

Nested Carousels lose state when scrolling down main recycler , Problem: When I scroll down the main recycler view, the nested carousel I cannot reproduce any issues with restoring state, in either the main  Returns true if the scroll offset and scroll range calculations take account of span information. open View ? onFocusSearchFailed ( focused : View , focusDirection : Int , recycler : RecyclerView.Recycler , state : RecyclerView.State )

used nestedScrollView

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

   <android.support.v4.widget.NestedScrollView
        android:id="@+id/nestedScrollView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:overScrollMode="never">


        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <android.support.v7.widget.RecyclerView
                android:id="@+id/recyclerView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />

        </LinearLayout>
     </android.support.v4.widget.NestedScrollView>
</LinearLayout>

Scrolling Scrolling RecyclerView for Android with Kotlin!, Part One: What is Recycler View and what does it actually recycle? ♻️. RecyclerView initiates an efficient way of creating ViewHolder objects,  Scrolling in Android: Custom Scroll Behavior for a List of Varying Height. (RecyclerView.State state) the amount scrolled will not always match up with the extant we have already traversed

Fixing RecyclerView nested scrolling in opposite direction, RecyclerView also supports nested scrolling by implementing the not available to child classes, so it can't just be copy-pasted and updated. Checks if RecyclerView is in the middle of a layout or scroll and throws an IllegalStateException if it is not. void: assertNotInLayoutOrScroll(String message) Checks if RecyclerView is in the middle of a layout or scroll and throws an IllegalStateException if it is. void: attachView(View child) Reattach a previously detached view

Scrollable NestedScrollViews inside RecyclerView, Also we cannot properly implement NestedScrollingParent without changing the code of RecyclerView itself. The solution we came up with is to  Some TextViews, some ImageViews, a RecyclerView, add a few constraints and Bam! the screen is ready. Except… The header doesn’t scroll, only the items in the RecyclerView.

Endless Scrolling with AdapterViews and RecyclerView, Delay before notifying the adapter since the scroll listeners // can be called while RecyclerView data cannot be changed. view.post(new Runnable() { @Override  It basically means the minimum distance to swipe until a RecyclerView (or something similar) cannot be scrolled. setSwipeListener(SwipeListener swipeListener): set the listener for the layout. You can use the full interface SwipeListener or a simplified listener class SimpleSwipeListener

Comments
  • Use Constraints or RelativeLayout as root to make button visiible . And i think its not scrolling because it has only 5 items if you did not consume touch event .
  • set android:layout_weight="1" to your RelativeLayout which have RecyclerView your issue will solved
  • @Arbaz.in Wow this works. Thank you. But I wonder why it works, though?
  • @anta40 because we set android:layout_weight="1 that means RelativeLayout occupied the space of your screen.
  • NestedScrollView is not a solution . This will only complicate the thing.