2017-03-03 105 views
0

我在谷歌支持库底部工作表内使用RecyclerView。我注意到有时底部表单会拦截触摸事件。我还没有找到这个问题的任何答案。BottomSheet正在拦截来自RecyclerView的触摸事件

我的屏幕看起来像这样

enter image description here

代码布局:

<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> 

感谢您的帮助!

回答

0

对于您需要停止回收视图的滚动,下面是该解决方案,

android:nestedScrollingEnabled="true"