scwang90 / SmartRefreshLayout

🔥下拉刷新、上拉加载、二级刷新、淘宝二楼、RefreshLayout、OverScroll,Android智能下拉刷新框架,支持越界回弹、越界拖动,具有极强的扩展性,集成了几十种炫酷的Header和 Footer。
https://segmentfault.com/a/1190000010066071
Apache License 2.0
24.91k stars 4.95k forks source link

如下布局,NestedScrollView嵌套SmartRefreshLayout,导致两个问题:1、无法惯性滑动到底部加载更多 2、手动上拉加载后,再次下拉刷新阻力很大。 #1086

Closed junyao-yu closed 4 years ago

junyao-yu commented 4 years ago

<androidx.core.widget.NestedScrollView android:id="@+id/mNetView" android:fillViewport="true" android:focusableInTouchMode="true" android:focusable="true" android:layout_width="match_parent" android:layout_height="match_parent">

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/white"
        android:orientation="vertical">
        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="138dp">
            <ImageView
                android:id="@+id/imageView"
                android:layout_width="match_parent"
                android:layout_height="118dp"/>
        </FrameLayout>
        <com.scwang.smartrefresh.layout.SmartRefreshLayout
            android:layout_marginTop="95dp"
            android:id="@+id/swipeRefreshLayout"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/mRecyclerView"
                android:layout_width="match_parent"
                android:layout_height="match_parent"/>
        </com.scwang.smartrefresh.layout.SmartRefreshLayout>
    </FrameLayout>

</androidx.core.widget.NestedScrollView>

NestedScrollView嵌套SmartRefreshLayout,导致两个问题: 1、无法惯性滑动到底部加载更多 2、手动上拉加载后,再次下拉刷新阻力很大。

YoYo-YY-YoYo commented 4 years ago

阻尼问题可以通过 refreshLayout.setDragRate(0.5f) 进行设置,或者在布局文件中设置属性app:srlDragRate="value" 进行设置.

jzm369 commented 4 years ago

一样的问题,请问解决了吗

junyao-yu commented 4 years ago

一样的问题,请问解决了吗

没有,后来不采用这种嵌套来做了。

IDoBelieve commented 4 years ago

同样遇到了该问题,你是不使用NestedScrollView了么?

Gui-Ji commented 4 years ago

同样遇到了该问题,你是不使用NestedScrollView了么?

请问如何解决的

Gui-Ji commented 4 years ago

一样的问题,请问解决了吗

请问解决了吗

jzm369 commented 4 years ago

一样的问题,请问解决了吗

请问解决了吗

没有。后面改成不做嵌套了

scwang90 commented 4 years ago

这是正常现象

Terry999555 commented 2 years ago

这是正常现象

大佬,这个有办法处理吗,涉及到很古老的代码,需要处理一下。滑动次数多了之后,阻尼系数越来越大。

fox0830 commented 1 year ago

同样遇到了这个问题,我改成了把整个NestedScrollView包裹在了SmartRefreshLayout里面