假如你的布局类似这样的:

  <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <android.support.v7.widget.RecyclerView
            android:layout_width="match_parent"
            android:layout_height="match_parent">
        </android.support.v7.widget.RecyclerView>
    </ScrollView>

展示没有问题,但是滑动的时候有卡顿问题,松手就停止滑动,感觉特别不爽,加上下面的代码试试:

        recyclerView.setHasFixedSize(true);
        recyclerView.setNestedScrollingEnabled(false);

大概就是让recyclerview的高度或宽度设置为最大不允许复用Item,然后禁止recyclerview滑动;

如果仍然卡顿,再试试这个:

recyclerview.setLayoutManager(new LinearLayoutManager(getActivity()){
            @Override
            public boolean canScrollVertically() {
                return false;
            }
        });

从LayoutManager层面禁止滑动,如果是横向的改为Horizontal;

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-16
  • 2021-07-21
  • 2021-11-18
猜你喜欢
  • 2022-12-23
  • 2021-08-27
  • 2022-12-23
  • 2022-12-23
  • 2021-06-13
  • 2022-12-23
  • 2021-06-10
相关资源
相似解决方案