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

查看:35
本文介绍了有没有办法在 Android ICS 中隐藏系统/导航栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想扩展关于在 Android Ice Cream Sandwich(4.0 及更高版本)平板设备上隐藏屏幕底部的系统/导航栏的讨论.

I'd like to extend the discussion regarding hiding of the system/navigation bar at the bottom of the screen on Android Ice Cream Sandwich (4.0 and up) tablet devices.

已经有一个线程(有没有办法在 Android 3.0 中隐藏系统栏?它是一个内部设备,我正在管理导航)关于在 Honeycomb 设备上隐藏栏.然而,我的客户将使用最新的 Ice Cream Sandwich 设备,并且非常热衷于将条形隐藏在屏幕底部.他们的应用程序不是供普通消费者使用的,对他们来说,接管整个屏幕以提供他们的体验非常重要.隐藏此栏 - 或者至少覆盖所有按钮的行为 - 而不生根设备或重写其固件,这有多大可能?

There's already a thread ( Is there a way to hide the system bar in Android 3.0? It's an internal device and I'm managing navigation ) about hiding the bar on Honeycomb devices. My clients, however, will be using the newest Ice Cream Sandwich devices and are very keen on hiding the bar at the bottom the screen. Their application is not for regular consumer use and it's very important for them to take over the whole screen to provide their experience. How possible is it to hide this bar -- or at least, override the behaviour of all the buttons -- without rooting the devices or rewriting its firmware?

推荐答案

查看 SYSTEM_UI_FLAG_HIDE_NAVIGATION,这个标志隐藏导航栏,直到用户与设备交互.它是在 Android 4.0 中引入的.您可以像这样启用此标志:

Check out SYSTEM_UI_FLAG_HIDE_NAVIGATION, this flag hides the navigation bar until the user interacts with the device. It was introduced in Android 4.0. You can enable this flag for example like this:

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

请注意,导航不会再次自动消失,您必须在每次用户与设备交互后进行设置.

Note that the navigation won't disappear again automatically, you have to set it every time after the user interacted with the device.

或者,您可以使用 SYSTEM_UI_FLAG_LOW_PROFILE,这会将按钮更改为小圆点(例如相机应用程序).

这篇关于有没有办法在 Android ICS 中隐藏系统/导航栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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