android隐藏标题栏和状态

方法一:

this.requestWindowFeature(Window.FEATURE_NO_TITLE);//去掉标题栏
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);//去掉信息栏



注意,这个设置必须放在设置布局前面,不然会报错.

setContentView(R.layout.entrancebs);



方法二:

在AndroidManifest.xml 里面



隐藏信息栏和标题栏:

<activity android:name=".Login" android:label="@string/app_name" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >



隐藏标题栏:

 <activity android:name=".Login" android:label="@string/app_name" android:theme="@android:style/Theme.NoTitleBar" >


自定义样式新增的话:

     sytle.xml

<item name="android:windowNoTitle">true</item>



修改标题:

setTitle("title name");

猜你喜欢

转载自pierce.iteye.com/blog/2098267