【发布时间】: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