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

7gcisfzg  于 5个月前  发布在  其他
关注(0)|答案(2)|浏览(45)
<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" />

相关问题