android去掉标题和状态栏的方法

1.在程序代码中控制:

this.requestWindowFeature(Window.FEATURE_NO_TITLE);//去掉标题栏  

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

WindowManager.LayoutParams.FLAG_FULLSCREEN);//去掉信息栏

应该放在setContentView之前,不然会报错。

 

2.在AndroidManifest.xml 文件中控制:

去掉标题栏和状态栏

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

去掉标题栏

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

如果放在application 下,就是去掉整个应用的。

如果放在某个activity下,就只去掉那个activity

你可能感兴趣的:(android,application)