is it possible to hide the system bar

前端 未结 5 1674
情歌与酒
情歌与酒 2020-11-28 10:13

I created a launcher, to use it in an internal application. for some security reasons i would like to hide the system bar (the acces to the parameter an ordrer to the acces

5条回答
  •  被撕碎了的回忆
    2020-11-28 10:47

    You can hide the navigation bar on Android 4.0 and higher using the SYSTEM_UI_FLAG_HIDE_NAVIGATION flag. This snippet hides both the navigation bar and the status bar:

    View decorView = getWindow().getDecorView();
    // Hide both the navigation bar and the status bar.
    // SYSTEM_UI_FLAG_FULLSCREEN is only available on Android 4.1 and higher, but as
    // a general rule, you should design your app to hide the status bar whenever you
    // hide the navigation bar.
    int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
                  | View.SYSTEM_UI_FLAG_FULLSCREEN;
    decorView.setSystemUiVisibility(uiOptions
    

    See the following: Hiding the Navigation Bar

提交回复
热议问题