简体   繁体   中英

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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