Remove grey padding on top of android layout


I added a NavigationView to my fragment and the drawer had an unnecessary grey top padding, I managed to remove this by adding app:insetForeground="@null" to it.

Now my layout is left with the top grey padding and I can’t seem to remove it with the same method I used for the drawer.


How can I remove this top grey part?


In styles.xml change from:

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">


<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">

PS: I saw your question at work but couldn’t response earlier. That’s why I write this answer, the specific could help others (with less coding experience) in the future. Cheers 🙂

Answered By – DEX7RA

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published