Android: how to hide ActionBar on certain activities

后端 未结 16 1961
遇见更好的自我
遇见更好的自我 2020-11-29 17:58

I\'ve developed a simple demo application with a splash screen a map and some regular screens.

I have an action bar at the top that contains a logo. It all looks fin

16条回答
  •  广开言路
    2020-11-29 18:22

    The above answers would help with the ActionBar thing. To add to it, use the following code in case you are using the Splash Screen: Use this before you set the content view:

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

    Just to clarify, here's how you do it:

        super.onCreate(savedInstanceState);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);         
        setContentView(R.layout.activity_main);
    

    This would make your screen a full screen, i.e remove the top bar where you see the network bar, etc

提交回复
热议问题