Android: making a fullscreen application

后端 未结 13 1956
北恋
北恋 2020-11-30 00:31

What is the simplest change that I can make to a new Blank Activity, as created by the latest version of Android Studio, to get the app to appear fullscreen?

I want

13条回答
  •  迷失自我
    2020-11-30 00:52

    in my case all works fine. See in logcat. Maybe logcat show something that can help you to resolve your problem

    Anyway you can try do it programmatically:

     public class ActivityName extends Activity {
            @Override
            public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                // remove title
                requestWindowFeature(Window.FEATURE_NO_TITLE);
                getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
                setContentView(R.layout.main);
            }
     }
    

提交回复
热议问题