Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hidden Navigation Bar still occupies space

Tags:

android

I'm using immersive full screen mode. The Action and Navigation bar are hidden, still, the navigation bar ocupies place in the screen.

enter image description here

That black space it's exactly the space of the nav bar. My layout never draw over that space... What can I do?

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    getWindow().getDecorView().setSystemUiVisibility(
            View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                    | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                    | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                    | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
                    | View.SYSTEM_UI_FLAG_FULLSCREEN
                    | View.SYSTEM_UI_FLAG_IMMERSIVE);
}
like image 768
flagg327 Avatar asked Sep 18 '16 23:09

flagg327


People also ask

How do I completely hide my navigation bar?

Touch “Settings” -> “Display” -> “Navigation bar” -> “Buttons” -> “Button layout”. Choose the pattern in “Hide navigation bar” -> When the app opens, the navigation bar will be automatically hidden and you can swipe up from the bottom corner of the screen to show it.

Can you hide the navigation bar?

Using the Show and hide button at the left side of the navigation bar, you can set the navigation bar to be hidden or pinned on the screen when you use apps or features. The navigation bar is pinned by default.

What is hide status and navigation bar?

Hiding the status bar (and optionally, the navigation bar) lets the content use more of the display space, thereby providing a more immersive user experience.


1 Answers

Look in your activity_main.xml for

android:fitsSystemWindows="true"

If you find, remove it or set false

like image 51
Ghustor Gameholic Avatar answered Oct 15 '22 09:10

Ghustor Gameholic