带有导航抽屉布局的Android Google地图

use*_*670 3 android google-maps navigation-drawer

我正在制作一个实现Google Maps V2地图的android应用。

当我实现include布局标签时,地图片段不会注册点击或屏幕上的任何类型的输入。但是,当我删除include标签时,我可以在地图上四处移动。

我已经四处闲逛,但是找不到任何可以帮助的东西。

我也尝试过此线程Google Maps V2 +抽屉布局, 但没有成功。

这是我的布局。

<FrameLayout
    android:id="@+id/content_frame"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <fragment
        android:id="@+id/map"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        class="com.google.android.gms.maps.SupportMapFragment" />
</FrameLayout>

<include layout="@layout/navigation_drawer" />
Run Code Online (Sandbox Code Playgroud)

帮助极大的赞赏。

谢谢

Ada*_*dam 5

抽屉布局必须是布局文件中的根元素,如下所示:

<android.support.v4.widget.DrawerLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <!-- google map -->
    <fragment xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/map"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:name="com.google.android.gms.maps.MapFragment"/>

</android.support.v4.widget.DrawerLayout>
Run Code Online (Sandbox Code Playgroud)