简体   繁体   English

Android 4.0.3隐藏通知栏和标题栏

[英]Android 4.0.3 Hide Notification Bar and Title Bar

I want to make my application go fullscreen in any android device. 我想让我的应用在任何Android设备上全屏显示。 Hide the Title bar and also the notification bar. 隐藏标题栏和通知栏。 The application is supposed to run on a 10 inch tablet on Android 4.0.3. 该应用程序应该在Android 4.0.3的10英寸平板电脑上运行。 I am using the following code but only the title bar disappears. 我正在使用以下代码,但是只有标题栏消失了。 I want to hide the notification bar also. 我也想隐藏通知栏。 Can anyone please tell me what I am doing wrong in my code ? 谁能告诉我我在代码中做错了什么吗?

getWindow().requestFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

try this 尝试这个

getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);

Hope it helps. 希望能帮助到你。

Edit: 编辑:

The SYSTEM_UI_FLAG_HIDE_NAVIGATION is a new flag that requests the navigation bar hide completely. SYSTEM_UI_FLAG_HIDE_NAVIGATION是一个新标志,请求完全隐藏导航栏。 Be aware that this works only for the navigation bar used by some handsets (it does not hide the system bar on tablets). 请注意,这仅适用于某些手机使用的导航栏(它不会隐藏平板电脑上的系统栏)。 The navigation bar returns to view as soon as the system receives user input. 系统收到用户输入后,导航栏将立即返回查看。 As such, this mode is useful primarily for video playback or other cases in which the whole screen is needed but user input is not required 因此,此模式主要用于视频播放或其他需要整个屏幕但不需要用户输入的情况

.

The thing holding the navigation buttons back and home, time, network information etc is referred to as "navigation" bar. 按住导航按钮并返回家,时间,网络信息等的东西称为“导航”栏。

You can not hide it within the given framework, but it is possible if rooting the device is an option for you: 您不能将其隐藏在给定的框架中,但是如果您可以选择使设备根目录是可能的

  1. Root device 根设备

  2. Install and run Busybox 安装并运行Busybox

  3. Install HideBar 安装HideBar

In HideBar there is an option to run in 'Kiosk' mode, in which there is no way to re-display the navigation bar. 在HideBar中,有一个选项可以在“信息亭”模式下运行,在该模式下无法重新显示导航栏。 Needless to say, you really need to be careful with this. 不用说,您确实需要对此谨慎。

This question was also asked here: 这里也问了这个问题:

Android tablet navigation bar won't hide Android平板电脑导航栏不会隐藏

How to remove system bars on Android, I mean, all 我的意思是,如何在Android上删除系统栏

Android tablet navigation bar won't hide Android平板电脑导航栏不会隐藏

Is there a way to hide the system/navigation bar in Android ICS 有没有办法在Android ICS中隐藏系统/导航栏

Hide Tablet system bar 隐藏平板电脑系统栏

Real Fullscreen with Android 4 Tablets 配备Android 4平板电脑的真正全屏

Easy way to hide system bar on Android ICS 在Android ICS上隐藏系统栏的简单方法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM