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">

 

 

 

 

posted @ 2013-10-17 09:16  yshy  阅读(809)  评论(0编辑  收藏  举报