android中如何隐藏应用程序标题栏和通知栏
16lz
2021-01-23
如果想同时隐藏标题栏和通知栏的话:
方法 1、 在manifest里面的activity加
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
方法2、 在activity的onCreate方法写入以下代码:
this.requestWindowFeature(Window.FEATURE_NO_TITLE);//去掉标题栏
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);//去掉信息栏
如果只是想隐藏标题栏的话:
方法 1、 在manifest里面的activity加
android:theme="@android:style/Theme.NoTitleBar"
方法2、 在activity的onCreate方法写入以下代码:
this.requestWindowFeature(Window.FEATURE_NO_TITLE);//去掉标题栏
更多相关文章
- adb命令执行java代码
- location of the android sdk has not been setup in the prefer
- wm命令使用方法(修改android 分辨率)修改
- android中在子线程中更新UI的几种方法
- Android Studio调错误方法
- Android动态设置Margin的方法
- 完美解决Android Studio在写XML布局的时候没有了控件代码提示的