1

I have following Layout:

<?xml version="1.0" encoding="utf-8"?>

<androidx.drawerlayout.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/idk"
  tools:openDrawer="start"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:fitsSystemWindows="true">
    <com.google.android.material.navigation.NavigationView
      android:id="@+id/nav"
      android:layout_width="wrap_content"
      android:layout_height="match_parent"
      android:layout_gravity="start"
      app:headerLayout="@layout/header"
      app:menu="@menu/mainmenu" />

</androidx.drawerlayout.widget.DrawerLayout>

And I don't see the menu when starting the application. However if I remove android:layout_gravity="start", I see the menu in the center of the screen.

What is the issue?

Pavel Bernshtam
  • 4,232
  • 8
  • 38
  • 62

0 Answers0