O
O
Oleg Gamega2015-09-15 17:14:06
Android
Oleg Gamega, 2015-09-15 17:14:06

How to put SupportMapFragment to DrawerLayout?

Hello.
encountered a strange bug when adding a SupportMapFragment to the DrawerLayout
The map overlaps the menu
96000f0e40dd408a8aec2726e6229b43.jpg
(it does not overlap on the screen and is shown normally, so the photo)

<?xml version    ="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        xmlns:fab="http://schemas.android.com/apk/res-auto">



        <fragment xmlns:android="http://schemas.android.com/apk/res/android"
            xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
            android:layout_height="match_parent" android:id="@+id/map"
            tools:context="com.smyt.locator.ui.map.MapsActivity"
            android:name="com.google.android.gms.maps.SupportMapFragment" />


        <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
            xmlns:app="http://schemas.android.com/tools"
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="@android:color/white"
            android:elevation="@dimen/default_elevation"
            android:layout_margin="16dp"
            app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

        </android.support.v7.widget.Toolbar>

    </RelativeLayout>


<android.support.design.widget.NavigationView
    android:id="@+id/nav_view"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:layout_gravity="start"
    android:fitsSystemWindows="true"
    app:headerLayout="@layout/nav_header"
    app:menu="@menu/drawer_menu" />

</android.support.v4.widget.DrawerLayout>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question