简体   繁体   English

如何在显示键盘时隐藏Android上的导航栏和状态栏?

[英]How to hide the navigation bar and the status bar on Android only when keyboard is shown?

我正在为Android制作一个自定义键盘,全屏,我只想在显示键盘时隐藏导航栏和Android上的状态栏,然后返回相同的状态。

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS)
}

Use the above given code to hide the status bar from the app. 使用上面给出的代码隐藏应用程序中的状态栏。 Also, don't forget to apply your keyboard visible condition. 另外,不要忘记应用键盘可见条件。

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

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