1.实现应用中的所有activity都全屏
在manifest中直接加入
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
2.实现单个activity全屏
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.TYPE_STATUS_BAR, WindowManager.LayoutParams.TYPE_STATUS_BAR);
3.实现单个activity去掉title栏
requestWindowFeature(Window.FEATURE_NO_TITLE);
1、改变标题内容:public void setTitle (CharSequence title)
2、隐藏标题:requestWindowFeature(Window.FEATURE_NO_TITLE);
3、隐藏标题和最上面的电池电量及信号栏(全屏):
public void setFullscreen() {
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
4、自定义标题内容
2)
MainActivity文件中:
requestWindowFeature(Window.FEATURE_NO_TIT