2

I'm using the bottom sheet fragment to display a pop up. I've used https://stackoverflow.com/a/51329005/5519745 to set the navigation bar color. However in a few devices there is a gap between the navigation bar and the bottom sheet dialog.

enter image description here

1 Answers1

2

I have used the same stack overflow solution as you to set a white background on the navigation bar and encountered the same problem.

I solved the issue by updating setWhiteNavigationBar setLayerInsetTop metrics.heightPixels field to a small minus of whatever desired to bring the bottom sheet down a bit.

Hope this helps.


Original

windowBackground.setLayerInsetTop(1, metrics.heightPixels);

Original with gap between bottomsheet and navbar


Amended

windowBackground.setLayerInsetTop(1, metrics.heightPixels - 2);

enter image description here


Sam L
  • 121
  • 7