Google Maps with Navigation Drawer Location
I am making an Android app that implements Google Maps V2.
When I implement the layout tag include layout, the map fragment does not register clicks or any type of input from the screen. but when i remove the include tag i can move the map around.
I turned around but I couldn't find anything to help.
I also tried this Google Maps V2 + Layer Layout theme with no success.
Here is my layout.
<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" />
Help with gratitude.
thank
+3
source to share
1 answer
The drawer layout must be the root element in the layout file, for example:
<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>
+4
source to share