BottomSheet 正在拦截来自 RecyclerView 的触摸事件
BottomSheet is intercepting touch events from RecyclerView
我在 google 支持库的 sheet 底部使用 RecyclerView。我注意到有时 bottom sheet 会拦截触摸事件。我还没有找到这个问题的任何答案。
我的屏幕是这样的
布局代码:
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/appColor">
<ui.view.GMapView
android:id="@+id/gMapView"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
<FrameLayout
android:id="@+id/mBottomSheet"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="android.support.design.widget.BottomSheetBehavior"
app:behavior_peekHeight="160dp"
app:behavior_hideable="false"
android:fillViewport="true"
android:orientation="vertical"
android:background="@color/uiColor"
>
<android.support.v7.widget.RecyclerView
android:id="@+id/rvAddresses"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
</FrameLayout>
</android.support.design.widget.CoordinatorLayout>
感谢您的帮助!
为此,您需要停止滚动回收站视图,下面是解决方案,
android:nestedScrollingEnabled="true"
我在 google 支持库的 sheet 底部使用 RecyclerView。我注意到有时 bottom sheet 会拦截触摸事件。我还没有找到这个问题的任何答案。
我的屏幕是这样的
布局代码:
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/appColor">
<ui.view.GMapView
android:id="@+id/gMapView"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
<FrameLayout
android:id="@+id/mBottomSheet"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="android.support.design.widget.BottomSheetBehavior"
app:behavior_peekHeight="160dp"
app:behavior_hideable="false"
android:fillViewport="true"
android:orientation="vertical"
android:background="@color/uiColor"
>
<android.support.v7.widget.RecyclerView
android:id="@+id/rvAddresses"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
</FrameLayout>
</android.support.design.widget.CoordinatorLayout>
感谢您的帮助!
为此,您需要停止滚动回收站视图,下面是解决方案,
android:nestedScrollingEnabled="true"