Display content behind the navigation bar

I am currently working on the fact that I want the status and navigation panels to be transparent and the content to remain with them. I currently have the bars set for @android: color / transparent in styles.xml and I can get the contents behind the status bar using this code:

getWindow().getDecorView().setSystemUiVisibility(
            View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
                   View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
            );

However, I am still struggling to take this place in the navigation bar. Any help was appreciated.

Thanks Josh

+4
source share
2 answers

Try adding them to your activity style.xml:

<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">true</item>
<item name="android:fitsSystemWindows">true</item>

hope this can help.

+2
source

You need:

getWindow()
  .setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);

See the answer here:

Display content behind state and navigation bar

+2

Source: https://habr.com/ru/post/1650731/


All Articles