SmartRefreshLayout 上拉加载更多,手指不松开屏幕一直滑动无法出现加载更多,需要手指松开重新向上滑动

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

implementation 'com.scwang.smart:refresh-layout-kernel:2.0.1' //核心必须依赖
implementation 'com.scwang.smart:refresh-header-classics:2.0.1' //经典刷新头
implementation 'com.scwang.smart:refresh-footer-classics:2.0.1' //经典加载
implementation 'androidx.appcompat:appcompat:1.1.0'

布局文件(CoordinatorLayout去掉这层布局就没有问题的)

<com.scwang.smart.refresh.layout.SmartRefreshLayout
    android:id="@+id/refreshLayout"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="1"
    app:srlDragRate="1">

    <com.scwang.smart.refresh.header.ClassicsHeader
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <androidx.coordinatorlayout.widget.CoordinatorLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <com.google.android.material.appbar.AppBarLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"

            app:elevation="0dp">
            <!--            app:layout_behavior="com.sun.testpopu.FixAppBarLayout"-->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                app:layout_scrollFlags="scroll|exitUntilCollapsed">

                <TextView
                    android:id="@+id/text_home"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="8dp"
                    android:layout_marginTop="25dp"
                    android:layout_marginEnd="8dp"
                    android:textAlignment="center"
                    android:textSize="20sp" />

                <Button
                    android:id="@+id/btn"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="申请权限" />

                <Button
                    android:id="@+id/btnHttp"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="网络请求测试" />

                <Button
                    android:id="@+id/btnViewLogin"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="登录测试" />

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="200dp"
                    android:gravity="center">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="布局占位" />
                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="200dp"
                    android:gravity="center">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="布局占位" />
                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="200dp"
                    android:gravity="center">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="顶部Tab" />
                </LinearLayout>
            </LinearLayout>

            <TextView
                android:id="@+id/goodsType"
                android:layout_width="match_parent"
                android:layout_height="45dp"
                android:background="@color/colorAccent"
                android:text="哈哈哈哈" />
        </com.google.android.material.appbar.AppBarLayout>

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/recyclerview"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_behavior="@string/appbar_scrolling_view_behavior" />
    </androidx.coordinatorlayout.widget.CoordinatorLayout>

    <com.scwang.smart.refresh.footer.ClassicsFooter
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />
</com.scwang.smart.refresh.layout.SmartRefreshLayout>

不知道描述有没有清楚:。我退回到
implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.0'
implementation 'com.scwang.smartrefresh:SmartRefreshHeader:1.1.0'
引用上述布局方式是没有问题的(控件名称需要修改)

vjhs03f7

vjhs03f71#

同样的情况,但是不想回退版本,等待后续

相关问题