scwang90 / SmartRefreshLayout

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

CoordinatorLayout+AppBarLayout+SmartRefreshLayout+RecyclerView 上拉加载无效 #1323

Open liangyongchen opened 3 years ago

liangyongchen commented 3 years ago

<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/commonBackgroundColor" android:orientation="vertical">

<androidx.coordinatorlayout.widget.CoordinatorLayout
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="1">

    <com.google.android.material.appbar.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/transparent"
        android:orientation="vertical"
        android:paddingLeft="12dp"
        android:paddingRight="12dp">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:orientation="vertical"
            app:layout_behavior="@string/appbar_scrolling_view_behavior"
            app:layout_scrollFlags="scroll|enterAlwaysCollapsed">

            <ImageView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:src="@drawable/bg_video_manage_common_hint" />

        </LinearLayout>

    </com.google.android.material.appbar.AppBarLayout>

    <com.scwang.smart.refresh.layout.SmartRefreshLayout
        android:id="@+id/mSmartRefreshLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:srlEnableNestedScrolling="true"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:gravity="center"
            android:orientation="vertical">

            <TextView
                android:id="@+id/tvStep"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="第1/2步"
                android:textColor="@color/common_color_666666"
                android:textSize="@dimen/_16sp" />

            <com.google.android.material.tabs.TabLayout
                android:id="@+id/mTabLayout"
                android:layout_width="match_parent"
                android:layout_height="48dp"
                android:layout_marginBottom="15dp"
                app:tabIndicatorColor="@color/transparent"
                app:tabIndicatorHeight="0dp"
                app:tabMode="scrollable"
                app:tabSelectedTextColor="@color/common_color_333333"
                app:tabTextAppearance="@style/TabLayoutTextStyle"
                app:tabTextColor="@color/grey_CCCCCC" />

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/mRecyclerView"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />

        </LinearLayout>

        <!--      底部刷新控件      -->
        <com.scwang.smart.refresh.footer.ClassicsFooter
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:srlTextLoading="正在加载..."
            app:srlTextNothing="- 我是有底线的人 -" />

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

</androidx.coordinatorlayout.widget.CoordinatorLayout>

<Button
    android:id="@+id/btnNext"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginLeft="50dp"
    android:layout_marginTop="15dp"
    android:layout_marginRight="50dp"
    android:layout_marginBottom="10dp"
    android:background="@drawable/shape_bg_blue_r8"
    android:text="下一步"
    android:textColor="@color/white"
    android:textSize="@dimen/_18sp" />

fangzhouguang commented 3 years ago

同问

jkbwfi commented 2 years ago

解决了吗