Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Navigation Drawer below Status Bar

Tags:

java

android

xml

I'm tring to make a Navigation Drawer using Design Support Library. In my activity_main i wrote this code.

<?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"
        xmlns:tools="http://schemas.android.com/tools"  
        android:id="@+id/drawer_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true">

    <LinearLayout
        android:id="@+id/layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

    <include
        android:id="@+id/toolbar"
        layout="@layout/toolbar"/>

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

    </LinearLayout>

   <android.support.design.widget.NavigationView
        android:id="@+id/navigation_view"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        app:headerLayout="@layout/header_layout"
        app:menu="@menu/menu_drawer"/>  

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

When i run my application it works and show the Navigation Drawer but it's below the Status Bar and not above. How can i move it to stay above the StatusBar?

like image 507
Ludovico Parsi Avatar asked Aug 29 '15 07:08

Ludovico Parsi


People also ask

Where is my navigation drawer?

The navigation drawer is a UI panel that shows your app's main navigation menu. The drawer appears when the user touches the drawer icon in the app bar or when the user swipes a finger from the left edge of the screen.

How do I get my navigation drawer to open full screen?

So to make full drawer just give android:layout_marginStart="-64dp" to navigation view or the container where the drawer will be loaded. Save this answer.


1 Answers

Just Simply add android:fitsSystemWindows="false" to DrawerLayout will solve the problem

like image 195
Ritesh Avatar answered Oct 12 '22 01:10

Ritesh