如何在平板电脑中隐藏系统导航栏? [英] How to Hide System Navigation Bar in Tablets?

查看:487
本文介绍了如何在平板电脑中隐藏系统导航栏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的平板电脑上,它具有用于控制后背,房屋等的栏(我不知道正确的名称,状态栏,控制栏,操作栏或其他)

At my Tablet, it has following bar to control back, home etc. (I don't know the correct name, status bar? control bar? Action bar? or other)

在程序中,它使用以下方法进行全屏显示.

In program, it use following method to have a full screen.

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

但是我不知道为什么酒吧还在这里.因此,我无法获得正确的屏幕尺寸.

But I don't know why the bar still in here. Because of it, I can't have the correct screen size.

谁可以告诉我如何删除它?

Who can tell me how to remove it?

推荐答案

在运行Android 4+的平板电脑中,无法隐藏系统/导航栏.

In Tablets running Android 4+, it is not possible to hide the System / Navigation Bar.

来自文档(系统UI控件可见性部分):

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).

但是,您有时可以像在游戏和视频播放期间一样尝试调暗系统栏.

However, you could try to dim the system bar as done sometimes during gaming and video playback.

SYSTEM_UI_FLAG_LOW_PROFILE标志替换STATUS_BAR_HIDDEN 旗帜.设置后,此标志为系统启用低调"模式 栏或导航栏.导航按钮变暗,并且其中的其他元素 系统栏也会隐藏.启用它对于创建更多内容很有用 无需沉迷于系统导航按钮的沉浸式游戏.

The SYSTEM_UI_FLAG_LOW_PROFILE flag replaces the STATUS_BAR_HIDDEN flag. When set, this flag enables "low profile" mode for the system bar or navigation bar. Navigation buttons dim and other elements in the system bar also hide. Enabling this is useful for creating more immersive games without distraction for the system navigation buttons.

这篇关于如何在平板电脑中隐藏系统导航栏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆