Closed Dboy233 closed 8 months ago
解决方法: 在你的代码 var helper = QuickAdapterHelper.Builder(adapter).build() 指定 helper.trailingLoadState = LoadState.NotLoading(false) 就可以了
解决方法:
在你的代码 var helper = QuickAdapterHelper.Builder(adapter).build()
指定 helper.trailingLoadState = LoadState.NotLoading(false) 就可以了
老哥,加在更多是一个占满全列的视图,如果是网格布局就会导致加在更多变成了一个某一列的item,而不能自成一行单列
StaggeredGridLayoutManager在TrailingLoadStateAdapter中重写onViewAttachedToWindow。
override fun onViewAttachedToWindow(holder: CustomLoadMoreVH) {
super.onViewAttachedToWindow(holder)
val lp = holder.itemView.layoutParams
if (lp is StaggeredGridLayoutManager.LayoutParams) {
lp.isFullSpan = true
}
}
GridLayoutManager使用QuickGridLayoutManager替代即可,其他Adapter需要满跨度的,可实现FullSpanAdapterType接口。
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:layoutManager="com.chad.library.adapter.base.layoutmanager.QuickGridLayoutManager"
app:spanCount="4"
tools:listitem="@layout/item_list" />
GridLayoutManager使用QuickGridLayoutManager替代即可,其他Adapter需要满跨度的,可实现FullSpanAdapterType接口。
<androidx.recyclerview.widget.RecyclerView android:id="@+id/recyclerView" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" app:layoutManager="com.chad.library.adapter.base.layoutmanager.QuickGridLayoutManager" app:spanCount="4" tools:listitem="@layout/item_list" />
@xylitol679 这个方法可以
@xylitol679 大佬,这个问题在3.0.7版本我这边也遇到了,就是瀑布流上拉加载更多偶现在某个item下,如果要自己处理该怎么处理呢
更新 4.0.3
再次尝试
目前只在 LinearlayoutManger 下正常。其他类型的 LayoutManager 异常。