Android: making a fullscreen application

后端 未结 13 2012
北恋
北恋 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:54

    You are getting this problem because the activity you are trying to apply the android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen"> to is extending ActionBarActivity which requires the AppCompat theme to be applied.

    Extend your activity from Activity rather than from ActionBarActivity

    You might have to change your Java class accordingly little bit.

    If you want to remove status bar too then use this before setContentView(layout) in onCreateView method

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

提交回复
热议问题