把谷歌地图放在AppBarLayout中

时间:2018-06-11 14:28:54

标签: android google-maps ontouchlistener android-coordinatorlayout android-appbarlayout

我想将谷歌地图片段放入AppBar Layout,但是当地图处于Appbar布局时,无法进行拖放控制。 有解决方案来解决这个问题吗?

<android.support.design.widget.AppBarLayout
        android:id="@+id/appbar"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
        android:fitsSystemWindows="true">

        <android.support.design.widget.CollapsingToolbarLayout
            android:id="@+id/collapsing_toolbar"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:fitsSystemWindows="true"
            app:contentScrim="?attr/colorPrimary"
            app:expandedTitleMarginStart="48dp"
            app:expandedTitleMarginEnd="64dp">

            <fragment
                android:id="@+id/map"
                class="com.stategram.app.ui.MapFragment"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />

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

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

0 个答案:

没有答案
相关问题