SmartRefreshLayout Activity滑动卡顿

dfty9e19  于 2个月前  发布在  其他
关注(0)|答案(1)|浏览(25)

为什么在Activity里面使用SmartRefreshLayout嵌套RecyclerView。下拉刷新的时候会卡顿,下拉不了,只能先网上再往下才会触发下拉刷新。以下是我的代码布局设置
<com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/refreshLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:srlEnableOverScrollBounce="false"
app:srlEnableOverScrollDrag="false">

<androidx.recyclerview.widget.RecyclerView
                    android:id="@+id/recycler"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:overScrollMode="never"
                    android:scrollbars="none"
                    app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
                    tools:itemCount="8"
                    tools:listitem="@layout/item_task_list" />

            </com.scwang.smart.refresh.layout.SmartRefreshLayout>

全局参数设置:
SmartRefreshLayout.setDefaultRefreshInitializer((context, layout) -> {
//全局设置(优先级最低)
layout.setEnableAutoLoadMore(false);
layout.setEnableOverScrollDrag(false);
layout.setEnableOverScrollBounce(false);
layout.setDisableContentWhenLoading(false);
layout.setDisableContentWhenRefresh(false);
layout.setEnableLoadMoreWhenContentNotFull(false);
layout.setEnableFooterFollowWhenNoMoreData(true);
layout.setEnableScrollContentWhenRefreshed(true);
layout.setEnableScrollContentWhenLoaded(true);
layout.setEnableFooterTranslationContent(true);
layout.setEnableHeaderTranslationContent(true);
layout.setPrimaryColorsId(R.color.colorTransparent, R.color.color666666,
R.color.colorTransparent);
layout.setDragRate(.7f).setReboundDuration(500).setHeaderMaxDragRate(4.0f)
.setHeaderHeight(50).setFooterMaxDragRate(4.0F).setFooterHeight(45);
});
SmartRefreshLayout.setDefaultRefreshHeaderCreator((context, layout) -> new ClassicsHeader(context).setTimeFormat(new DynamicTimeFormat("更新于 %s")));
SmartRefreshLayout.setDefaultRefreshFooterCreator((context, layout) -> new ClassicsFooter(context));

n3h0vuf2

n3h0vuf21#

解决了嘛 我也发现有这个问题 下拉卡壳

相关问题