DrawerLayout with Google Maps

I have a problem with Google DrawerLayout when it is put into action with a map fragment. I have not tried using MapView, but I am afraid that the problem will remain the same.

I use google DrawerLayout from the support library (v13) and place the map inside it.

The problem that I have is better explained using images ... In 2.2-2.3 (excellent at 4.0+), the box does not appear if it is located where the fragment of the Google map is drawn. The rest of the view, along with the widgets in the view, is shaded properly, but not on the map.

Here is my xml layout

<?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:map="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:weightSum="4"> <fragment android:id="@+id/map" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="3" android:name="com.google.android.gms.maps.SupportMapFragment" android:scrollingCache="false" map:cameraTargetLat="39.828325" map:cameraTargetLng="-98.579728" map:cameraZoom="2" map:cameraTilt="0" map:cameraBearing="0"/> <LinearLayout android:id="@+id/map_fragmentHolder" android:layout_height="0dp" android:layout_width="match_parent" android:orientation="vertical" android:layout_weight="1" /> </LinearLayout> <include layout="@layout/menu_layout" android:layout_height="wrap_content" android:layout_width="match_parent" android:layout_gravity="start" /> </android.support.v4.widget.DrawerLayout> 

This is what is seen on 2.x devices, the picture was taken in the Android debug monitor, and the square should be one of my DrawerLayout buttons.

Android 2.x

Here's how it should look:

Android 4.x

I have concerns that this is because the Gmaps object is drawn on FrameLayout, but I really don't know.

Does anyone come across this problem or have ideas on how to solve it? Thanks.

+7
source share
1 answer

I ran into this problem and I tried this solution: stack overflow It worked for me. Please, try.

+10
source

All Articles