Android Activity设置为全屏的方法
1:代码方式:
放到setContentView之前
//隐藏标题栏 this.requestWindowFeature(Window.FEATURE_NO_TITLE); //隐藏状态栏 this.getWindow().setFlags( WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
2:通过配置文件方法:
让某个Activity全屏:
<activity android:name=".ActivityDemoActivity" android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
让整个项目全屏:
<application android:icon="@drawable/icon" android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">