scwang90 / SmartRefreshLayout

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

CoordinatorLayout+AppBarLayout+CollapsingToolbarLayout+Toolbar #1517

Closed sea5241 closed 1 year ago

sea5241 commented 1 year ago

CoordinatorLayout+AppBarLayout+CollapsingToolbarLayout+Toolbar嵌套SmartRefreshLayout,在Android12的模拟器上无法折叠,顶部多了空白,在Android10的模拟器上是可以的,在真机Android12上也是可以的,怀疑是原生系统的兼容性问题 布局如下: <androidx.coordinatorlayout.widget.CoordinatorLayout android:id="@+id/cl_content" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/home_white" android:orientation="vertical">

    <ImageView
        android:id="@+id/iv_water_fall_bg"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/c_F9F9F9"
        android:scaleType="fitXY"
        android:src="@drawable/home_water_fall_content_bg"
        android:visibility="gone" />

    <com.google.android.material.appbar.AppBarLayout
        android:id="@+id/abl_appbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/home_white"
        app:elevation="0dp">

        <com.google.android.material.appbar.CollapsingToolbarLayout
            android:id="@+id/citl_head"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_scrollFlags="scroll|exitUntilCollapsed">

            <androidx.appcompat.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="@dimen/home_d_48"
                app:layout_collapseMode="pin" />
         <ImageView
                android:layout_width="match_parent"
                android:layout_height="100dp"
                app:layout_collapseMode="pin"/>
        </com.google.android.material.appbar.CollapsingToolbarLayout>
    </com.google.android.material.appbar.AppBarLayout>
     <com.scwang.smart.refresh.layout.SmartRefreshLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">
             <androidx.recyclerview.widget.RecyclerView
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>
        </com.scwang.smart.refresh.layout.SmartRefreshLayout>

</androidx.coordinatorlayout.widget.CoordinatorLayout>