it-swarm.com.de

Vollbild-Navigationsleiste

Ich habe eine Navigationsleiste wie this .

Was ich tun möchte, ist, meine Schublade im Vollbildmodus und nicht im halben Bildschirm zu öffnen. Wie kann ich diese Schublade als Vollbildschirm öffnen lassen?

Dies ist xml des Schubladenlayouts

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:layout_width="match_parent"
    Android:layout_height="match_parent"
    Android:fitsSystemWindows="true">

<include
    Android:id="@+id/toolbar_layout"
    layout="@layout/app_toolbar"
    Android:layout_width="match_parent"
    Android:layout_height="wrap_content" />

<Android.support.v4.widget.DrawerLayout
    Android:id="@+id/drawer_layout"
    Android:layout_width="match_parent"
    Android:layout_height="match_parent"
    Android:layout_below="@id/toolbar_layout"
    Android:fitsSystemWindows="true"
    tools:openDrawer="start">

    <FrameLayout
        Android:id="@+id/activityMainContent"
        Android:layout_width="match_parent"
        Android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior" />

    <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:background="@color/colorPrimary"
        Android:fitsSystemWindows="true"
        app:headerLayout="@layout/nav_header_main"
        app:itemTextColor="@Android:color/white"
        app:menu="@menu/activity_main_drawer" />
</Android.support.v4.widget.DrawerLayout>
</RelativeLayout>
7
Shrikant

Sie können diesenavigationView-Eigenschaft zu 100% testen

<Android.support.design.widget.NavigationView
    Android:id="@+id/nav_view"
    Android:layout_width="match_parent"
    Android:layout_height="match_parent"
    Android:layout_gravity="start"
    Android:fitsSystemWindows="true"
    Android:layout_marginEnd="-65dp"
    Android:layout_marginRight="-65dp"
    app:itemTextColor="@color/lightgray"
    app:itemIconTint="@color/colorAccent"
    app:headerLayout="@layout/nav_header_main"
    app:menu="@menu/activity_main_drawer" />
18
Ratilal Chopda

versuche diese Hoffnung, dass es funktioniert:

<include
        Android:id="@+id/left_drawer"
        Android:orientation="vertical"
        Android:layout_width="match_parent"
        Android:layout_height="match_parent"
        Android:layout_gravity="start"
        layout="@layout/drawer"
        Android:layout_marginLeft="-64dp"/>
1
Apoorv Mehrotra

Sie müssen Ihre DrawerLayout als Hauptlayout in Ihre xml einfügen:

<?xml version="1.0" encoding="utf-8"?>
<Android.support.v4.widget.DrawerLayout
    Android:id="@+id/drawer_layout"
    Android:layout_width="match_parent"
    Android:layout_height="match_parent"
    Android:layout_below="@id/toolbar_layout"
    Android:fitsSystemWindows="true"
    tools:openDrawer="start">

<RelativeLayout 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:layout_width="match_parent"
    Android:layout_height="match_parent"
    Android:fitsSystemWindows="true">

<include
    Android:id="@+id/toolbar_layout"
    layout="@layout/app_toolbar"
    Android:layout_width="match_parent"
    Android:layout_height="wrap_content" />

    <FrameLayout
        Android:id="@+id/activityMainContent"
        Android:layout_width="match_parent"
        Android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior" />

    <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:background="@color/colorPrimary"
        Android:fitsSystemWindows="true"
        app:headerLayout="@layout/nav_header_main"
        app:itemTextColor="@Android:color/white"
        app:menu="@menu/activity_main_drawer" />

</RelativeLayout>

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