在全屏模式下使用导航视图的Android Activity在底部显示灰色半透明区域 [英] Android Activity using navigation view in full screen mode shows at the bottom a grey translucent area
本文介绍了在全屏模式下使用导航视图的Android Activity在底部显示灰色半透明区域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个活动,该活动使用以下方法启用全屏模式。
I have an activity which is using the following method to enable fullscreen mode.
protected void hideSystemUI() {
View decorView = getWindow().getDecorView();
decorView.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
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
}
在此活动中,我还使用了 NavigationView 并且当 NavigationView 在底部(导航按钮所在的位置)可见时,将显示灰色半透明。
我的问题是如何隐藏该区域。
In this activity I am also using the NavigationView and when the NavigationView is visible at the bottom(where the navigation buttons are located) a grey translucent is visible. My question is how can I hide this area.
推荐答案
我通过删除从方法 hideSystemUI
中标记 View.SYSTEM_UI_FLAG_LAYOUT_STABLE
。现在该方法如下所示:
I solved the issue by removing the flag View.SYSTEM_UI_FLAG_LAYOUT_STABLE
from the method hideSystemUI
. Now the method looks like this:
protected void hideSystemUI() {
View decorView = getWindow().getDecorView();
decorView.setSystemUiVisibility(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);
}
这篇关于在全屏模式下使用导航视图的Android Activity在底部显示灰色半透明区域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文