Sashi Kiran
Sashi Kiran

Reputation: 306

Navigation bar hides but leaves space when using navigation drawer in android 5+

I am trying to develop a full-screen app with 2 main activities: LoginActivity and DashboardActivity.

LoginActivity has only the UI for user input to login like Username and password. In this screen the nav and status bar gets hidden completely without leaving any space.

After login in the DashboardActivity I have a toolbar with Navigation drawer. In this activity I did all things I did in LoginActivity. What happens is the Nav and status bar gets hidden but the space occupied by Nav bar before hiding alone stays.

This happens only in Android 5+. It works fine in Kitkat.

Here are the snapshots: Before Hiding / After Hiding

Upvotes: 4

Views: 2285

Answers (2)

Kunjesh Virani
Kunjesh Virani

Reputation: 84

If your are using a Jetpack Compose then only provide a calculated bottom padding to the content container. If you provide all inner paddingValues then it will work fine on Portrait mode but won't work on Landscape mode.

Upvotes: 0

Vikram singh
Vikram singh

Reputation: 375

I am also stucked to same problem .Easy to fix remove this tag from xml fitsSystemWindows from drawerlayout and from navigation view

set height of navigation view to wrap content

Upvotes: 5

Related Questions