android: how to remove the back/home button in the action bar

后端 未结 9 1511
一向
一向 2020-12-29 02:20

I am having difficulties trying to remove the back/home button from the action bar.

 getActionBar().setDisplayShowHomeEnabled(false);   //disable back button         


        
9条回答
  •  被撕碎了的回忆
    2020-12-29 03:18

    This code work for me

    For remove navigation bar getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);

    For remove status bar getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN);

    ฺBut above code, it show again when you touch on screen, so if you want static state, combine this code.

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

提交回复
热议问题