Activity的全屏显示

第一步:Java代码

this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);

1、添加时机:在需要全屏显示的activity的界面显示函数setContentView( )调用前进行设置,否则报错误:

第二步:通过XML文件进行配置

在AndroidManifest.xml中,为需要进行全屏显示的activity添加如下主题:

android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

posted on 2014-02-19 16:03  楠妮儿  阅读(119)  评论(0编辑  收藏  举报

导航