0

我正在创建 android 应用程序,其中有底部导航栏,如 youtube 和其他社交媒体。我的应用程序中有一个文本框,所以当我在文本框上键入时,键盘是打开的,底部导航栏位于我的键盘上。那么当我开始输入时如何隐藏底部导航栏。

应用程序的父布局是线性布局。

而adjustPan 将不起作用。

4

1 回答 1

-1

你可以这样做

View decorView = getWindow().getDecorView();
// Hide both the navigation bar and the status bar.
// SYSTEM_UI_FLAG_FULLSCREEN is only available on Android 4.1 and higher, but as
// a general rule, you should design your app to hide the status bar whenever you
// hide the navigation bar.
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
              | View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);

参考:https ://developer.android.com/training/system-ui/navigation

于 2018-10-05T03:53:20.673 回答