问题描述
我正在开发一个需要完全全屏显示的应用程序。在kitkat中,使用 Immersive
标签非常容易。但是由于并非所有设备都支持kitkat,所以我需要考虑JB和ICS(至少)。
I am developing an Application where I need to go completely full screen. In kitkat its very easy by using Immersive
tag. But since not all devices support kitkat I need to take JB and ICS (atleast) into consideration.
虽然在JB和ICS中有一种隐藏导航栏和状态栏的方法,但是一旦用户进行交互,它就会变得可见。这当然看起来不好。
Well although there is a way of hiding navigation bar and status bar in JB and ICS it becomes visible as soon as the user interacts. This certainly does not looks good. It also takes one extra touch.
我在网上做了很多搜索,但感到惊讶的是我们无法实现它。我希望找到一些技巧或黑客,但什么也没有。
I did a lot of searching on net and was surprised that there is no way we can achieve it. I was hoping to find some trick or hack but nothing.
我很确定在kitkat出现之前,有一些游戏使用全屏显示,所以我想应该有一种方法(例如Temple Run和Andgry Birds)。有人可以指导我正确的方向吗?
I am pretty sure that before kitkat came there were games which used full screen so I guess there should be a way (like Temple Run and Andgry Birds). Can some one please guide me in correct direction.
PS:我正在寻找非根目录设备的解决方案。
P.S: I am looking solution for devices which are not rooted.
谢谢:)
推荐答案
使用全屏主题,或按照此处所述
正如我已经在评论,这将为您提供全屏显示。并非KitKat上的沉浸式模式,用户可以轻松地取消隐藏状态栏。如果您要使用主题方法,最好在API19 +(KitKat)上设置一个非全屏主题,然后从那里开始让它使用沉浸模式。
Use a full screen theme, or set it from code as described here https://developer.android.com/training/system-ui/status.htmlAs I already pointed out in the comments, this will give you full screen. Not the immersive mode as seen on KitKat where the user can easily unhide the status bar. If you're going with the theme approach it's probably best to set a not full screen theme on API19+ (KitKat) and tell it to use Immersive mode from there on.
这篇关于JB和ICS中的沉浸式功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!