【问题标题】:RecyclerView inside of SwipeRefreshLayout not clickableSwipeRefreshLayout 内的 RecyclerView 不可点击
【发布时间】:2021-11-07 13:01:40
【问题描述】:

我的应用程序的刷新布局中有一个回收器视图,由于某种原因,如果回收器视图位于最顶部,则只有第一个项目是可点击的,滚动偏移量 = 0。 如果我在滚动偏移量为 0 的情况下将偏移量设置为 1,则所有项目都是可点击的,但是,这会使刷卡刷新停止工作。有谁知道为什么会这样?

<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
    android:id="@+id/exchanges_swipe_refresh"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintBottom_toBottomOf="parent">

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/rv_exchanges"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:paddingVertical="8dp"
        android:visibility="invisible"
        android:clipToPadding="false"
        tools:listitem="@layout/exchanges_list_item"/>

</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

【问题讨论】:

    标签: android kotlin android-recyclerview swiperefreshlayout


    【解决方案1】:

    我有同样的问题,我确实有一个 ConstraintLayout 包装 SwipeRefreshLayout。

    我刚刚将其更改为LinearLayoutCompat,它的工作原理

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-07-20
      • 2023-03-11
      • 2014-09-30
      • 2016-10-24
      相关资源
      最近更新 更多