Android 4.0.3 隐藏通知栏和标题栏

标签 android android-notification-bar

我想让我的应用程序在任何 Android 设备上全屏显示。隐藏标题栏和通知栏。该应用程序应该在 Android 4.0.3 的 10 英寸平板电脑上运行。 我正在使用以下代码,但只有标题栏消失。我也想隐藏通知栏。谁能告诉我我的代码中做错了什么?

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

最佳答案

试试这个

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

希望有帮助。

编辑:

The SYSTEM_UI_FLAG_HIDE_NAVIGATION is a new flag that requests the navigation bar hide completely. 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

.

关于Android 4.0.3 隐藏通知栏和标题栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10961178/

相关文章:

java - 显示ListView的子项和标题

android - 为什么 FLAG_KEEP_SCREEN_ON 不能正常工作?

java - 列表<? extends Something > 生成而不是 List<Something>

android - 电话响铃时调用的Activity叫什么

android - 为什么 "download completed"通知在 Gingerbread 设备上消失了?

android - Galaxy S4 上带有动态壁纸的透明通知栏

Android - 在通知栏保持通知稳定

android - 如何从通知中删除 "+999"?

android导出eclipse项目

android - 自定义ExpandableListView时默认箭头继续出现