// This snippet hides the system bars.
2 private void hideSystemUI() {
3 // Set the IMMERSIVE flag.
4 // Set the content to appear under the system bars so that the content
5 // doesn't resize when the system bars hide and show.
6 //开启全屏模式
7 mDecorView.setSystemUiVisibility(
8 View.SYSTEM_UI_FLAG_LAYOUT_STABLE
9 | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
10 | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
11 | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar
12 | View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar
13 | View.SYSTEM_UI_FLAG_IMMERSIVE);
14 }
15
16 // This snippet shows the system bars. It does this by removing all the flags
17 // except for the ones that make the content appear under the system bars.
18 //取消全屏模式
19 private void showSystemUI() {
20 mDecorView.setSystemUiVisibility(
21 View.SYSTEM_UI_FLAG_LAYOUT_STABLE
22 | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
23 | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
24 }
Android去掉系统状态栏(全屏显示)
原创嵌入式软件开发交流 博主文章分类:Android应用开发 ©著作权
©著作权归作者所有:来自51CTO博客作者嵌入式软件开发交流的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
Nginx 配置反向代理去除前缀
Nginx 配置反向代理去除前缀
Nginx 服务器 反向代理 -
android 去除状态栏半透明 手机状态栏透明
最近项目上有需求 ,要求状态栏透明化 。还有需求是拖动状态栏标题一下的内容,标题栏的颜色要变化 。这里所谓的既是状态栏着色,也是我们经常听到的沉浸式状态栏,关于沉浸式的称呼网上也有很多吐槽的,这里就不做过多讨论了,以下我们统称状态栏着色,这样我觉得更加容易理解。从Android4.4开始,才可以实现状态栏着色,并且从5.0开始系统更加完善了这一功能,可直接在主题中设置<item name="
android 去除状态栏半透明 Android android 状态栏 android 状态栏着色 android 透明窗