how do you remove the navigation bar on Android?

前端 未结 7 752
梦毁少年i
梦毁少年i 2021-02-11 02:52

When I listen to a YouTube video fullscreen in landscape on my Galaxy Nexus, the navigation bar on the right disapear after a few seconds (the bar which contains the "back&

7条回答
  •  北恋
    北恋 (楼主)
    2021-02-11 03:04

    What you should do is set System Ui Visibility in onResume()

    getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
    

    If you wont set it sticky bar will be visible again when touch screen will be occured

提交回复
热议问题