How to make RecyclerView scroll smoothly?

前端 未结 9 1400
-上瘾入骨i
-上瘾入骨i 2020-12-30 21:16

This is more like a generic question, but after lot of search and try I am not able to understand why this is so difficult to achieve. This is the closest answer I can find

相关标签:
9条回答
  • 2020-12-30 21:50

    Add this wherever you have declared RecyclerView in your Activity or Fragment

    RecyclerView mRecyclerview = (RecyclerView) findViewById(...);
    mRecyclerview.setNestedScrollingEnabled(false);
    

    setNestedScrollview(false) does the work for you.

    0 讨论(0)
  • 2020-12-30 21:57

    I just faced this problem, and disabling nested scroll fixed it. Do it like this:

    yourRecyclerview.setNestedScrollingEnabled(false);
    

    Or you can change the value in xml file where you defined RecyclerView:

    <android.support.v7.widget.RecyclerView
        android:id="@+id/yourRecyclerView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:nestedScrollingEnabled="false"/>
    
    0 讨论(0)
  • 2020-12-30 22:01

    I just faced this problem, and i got I put the RecyclerView in ScrollView So please never put the RecyclerView inside the ScrollView that may also cause.

    mLayoutManager.findFirstVisibleItemPosition()
    

    That always return a fixed value. And also check

    recyclerview.setNestedScrollingEnabled(false);
    
    0 讨论(0)
  • 2020-12-30 22:01

    You need to use the "Picasso" library to load image asynchronously, and also make sure that the size of the image which you load is similar to the size of image view in the layout, using the fit() function. Also, if you are using a recycler view inside the scroll view, make sure to set nested scrolling to false.

    I solved my issue using the above three methods

    0 讨论(0)
  • 2020-12-30 22:02
    android:animateLayoutChanges="false"
    
    0 讨论(0)
  • 2020-12-30 22:02

    just add this

    animateLayoutChanges = true 
    

    in recyclerview xml

    0 讨论(0)
提交回复
热议问题