我有一个带有RecyclerView
的BottomSheetDialogFragment
。问题是,只要RecyclerView
没有向上滚动,我想禁用BottomSheetDialogFragment
的拖动关闭功能(当前我无法滚动RecyclerView
,因为尝试滚动将始终关闭BottomSheetDialogFragment
)。有什么办法可以实现这一点吗?
我有一个带有RecyclerView
的BottomSheetDialogFragment
。问题是,只要RecyclerView
没有向上滚动,我想禁用BottomSheetDialogFragment
的拖动关闭功能(当前我无法滚动RecyclerView
,因为尝试滚动将始终关闭BottomSheetDialogFragment
)。有什么办法可以实现这一点吗?
android:nestedScrollingEnabled="true"
使用约束布局
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_team_mates"
android:layout_width="@dimen/dp_0"
android:layout_height="@dimen/dp_0"
android:layout_marginVertical="@dimen/dp_20"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/txt_title_custom"
app:layout_constraintBottom_toBottomOf="parent"/>
RecyclerView
放置在NestedScrollView
下面,其中NestedScroll是recycler的父级。
RecyclerView
已经支持作为一个嵌套滚动视图了... - prom85