繁体   English   中英

在我的Android应用程序中隐藏底部的导航面板?

[英]Hide the bottom Navigation Panel in my application in Android?

我正在开发一个必须隐藏底部导航面板的应用程序。 我已经搜索并实现了代码:

        private void hideSystemUI() {

             View mDecorView =getWindow().getDecorView();

            // Set the IMMERSIVE flag.
            // Set the content to appear under the system bars so that the content
            // doesn't resize when the system bars hide and show.
            mDecorView.setSystemUiVisibility(
                    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 // hide nav bar
                    | View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar
                    | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
        }

一切正常。

问题:当我打开屏幕上的任何DAILOG或弹出键盘时,底部的导航面板再次弹出。

请提出建议,我该如何处理。

 this works,

  public void FullScreencall() {
    if(Build.VERSION.SDK_INT < 19) //19 or above api
        View v = this.getWindow().getDecorView();
        v.setSystemUiVisibility(View.GONE);
    } else {
            //for lower api versions.
        View decorView = getWindow().getDecorView(); 
        int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
        decorView.setSystemUiVisibility(uiOptions);
    }
}

在ur oncreat上调用此方法。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM