BaseRecyclerViewAdapterHelper icon indicating copy to clipboard operation
BaseRecyclerViewAdapterHelper copied to clipboard

NestedScrollView+嵌套+RecyclerView问题

Open gaohequan opened this issue 1 year ago • 2 comments

Describe the bug 使用的是4.1.4开源库和github中demo。 当NestedScrollView+嵌套+RecyclerView 会发现helper = QuickAdapterHelper.Builder(mAdapter) .setTrailingLoadStateAdapter(object : OnTrailingListener { override fun onLoad() { request() }

            override fun onFailRetry() {
                request()
            }

            override fun isAllowLoading(): Boolean {
                return !viewBinding.refreshLayout.isRefreshing
            }
        }).build()
        中 onload会一直加载。

如果使用helper.trailingLoadStateAdapter?.checkDisableLoadMoreIfNotFullPage();方法 ,则无法自动加载。 重现不中 只需要 把demo中的 activity_load_more.xml布局改成
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout android:id="@+id/refresh_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/bg" android:orientation="vertical">

    <androidx.core.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/rv_list"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:nestedScrollingEnabled="false"/>
    </androidx.core.widget.NestedScrollView>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

gaohequan avatar Apr 15 '24 05:04 gaohequan

请问怎么解决的?

runitwolf-sloop avatar Nov 04 '24 09:11 runitwolf-sloop

添加 android:nestedScrollingEnabled="false" 也不行

runitwolf-sloop avatar Nov 04 '24 09:11 runitwolf-sloop

NestedScrollView 禁止嵌套 RecyclerView,Google官方就不建议这样做。这不是本库的问题。 NestedScrollView 嵌套 RecyclerView 会导致 RecyclerView 的复用机制失效!

limuyang2 avatar Oct 10 '25 08:10 limuyang2