KitKat上显示导航栏

KitKat上显示导航栏

本文介绍了隐藏导航栏后在Android KitKat上显示导航栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用中,我想让用户隐藏或显示导航栏(后退,主页,菜单).系统栏(电池,wifi,通知)应始终处于隐藏状态.

In my app I want to let the user hide or show the Navigation Bar (back, home, menu). The System Bar (battery, wifi, notifications) should always be hidden.

我用以下代码隐藏系统栏:

I hide the System Bar with this code:

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

并且我成功隐藏了带有以下标志的导航栏:

And I am successfully hiding the Navigation Bar with these flags:

final static int flagsHide = View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                    | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                    | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                    | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
                    | View.SYSTEM_UI_FLAG_FULLSCREEN
                    | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;

但是我还没有发现如何再次显示导航栏.我可以用标志来做还是需要其他东西?系统栏必须保持不可见.

But I haven't found on how to show the Navigation Bar again. Can I do that with flags or do I need something else? The System Bar has to stay invisible.

推荐答案

使用此标志再次显示它

    SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN  |
 SYSTEM_UI_FLAG_LAYOUT_STABLE

这篇关于隐藏导航栏后在Android KitKat上显示导航栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 14:52