小编Oli*_*ler的帖子

在CoordinatorLayout中平移谷歌地图会导致recyclerview在android设计支持库23.0.1中滚动

该地图位于collapsingToolbarLayout中,该套接字嵌套在appBarLayout中.在android设计支持库的22.2.0和22.2.1版本中,我可以独立于coordinatorLayout平移地图,但在23.0.1中,如果我尝试在北/南轴上平移地图,则会导致recyclelerview向上/向下滚动.这是一个错误还是有办法将触摸事件从appBarLayout传递到mapFragment?

<android.support.design.widget.AppBarLayout
    android:id="@+id/app_bar_layout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:fitsSystemWindows="true">

    <android.support.design.widget.CollapsingToolbarLayout
        android:id="@+id/collapsing_toolbar_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:fitsSystemWindows="true"
        app:contentScrim="?attr/colorPrimary"
        app:layout_scrollFlags="scroll|enterAlways">

        <fragment
            android:id="@+id/mapFragment"
            android:name="com.google.android.gms.maps.MapFragment"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_collapseMode="parallax" />


    </android.support.design.widget.CollapsingToolbarLayout>

</android.support.design.widget.AppBarLayout>

<android.support.v7.widget.RecyclerView
    android:id="@+id/recyclerView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="#44CCFF"
    app:behavior_overlapTop="184dp"
    app:layout_behavior="@string/appbar_scrolling_view_behavior" />

<android.support.design.widget.FloatingActionButton
    android:id="@+id/fab"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom|right"
    android:layout_margin="16dp"
    android:src="@drawable/ic_list_white_24dp"
    app:backgroundTint="#3366FF"
    app:fabSize="normal" />
Run Code Online (Sandbox Code Playgroud)

android google-maps androiddesignsupport android-coordinatorlayout

13
推荐指数
2
解决办法
5025
查看次数