底部工作表中的 swiperefreshlayout 不滚动

mer*_*hop 5 android android-layout

我在底页中有 recyclerview,效果很好。当我在回收器视图周围引入 swiperefreshlayout 时,它不允许我向上滚动,它只会折叠底部表格。我希望它滚动回收器视图,到达顶部,然后触发刷新。如果需要的话,我可以消除底页上的拖动折叠行为。

   <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/content"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@android:color/background_light"
        app:behavior_peekHeight="?actionBarSize"
        app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior" >

        <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
            android:id="@+id/refresh_layout"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:visibleGone="@{ model.locPerms }"
            app:onRefreshListener="@{ () -> model.refreshPois() }"
            app:refreshing="@{ model.refreshing }">

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/list_pois"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:clipToPadding="false"
                tools:listitem="@layout/poi_item"
                app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"/>

        </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

    </androidx.constraintlayout.widget.ConstraintLayout>
Run Code Online (Sandbox Code Playgroud)

小智 7

尝试禁用 recyclerView 上的嵌套滚动

list_poits.isNestedScrollingEnabled = false
Run Code Online (Sandbox Code Playgroud)