简体   繁体   中英

Android ActionBar doesn't hide after text input in cordova/phonegap with marshmallow

This seems like it could be a bug, but as with all things i'm sure there is also a work-around. The problem description is this; using cordova to develop an android app with a simple page with some textfields, when typing into those fields on the app the softkeyboard appears so that you can enter text, but then when you either "enter" or focus on another element, the keyboard fades away but leaves the "ActionBar" at the bottom of the view.

The ActionBar remains, and if one's app is designed to run full screen - the action bar may overlap app content. The ActionBar itself cannot be swiped down or removed by the end user except for swiping down from the very top (the title bar) then swiping back up again.

This seems to be an issue as of Android 6.0.0 or perhaps I just wasn't noticing it before.

I've noticed that with the plugin cordova-plugin-dialogs that when i use the alert dialog after i close it, the actionbar hides, but I think that ultimately the scenario that would work best is that after X-timeout from typing in a textfield and/or the softkeyboard fades out, the ActionBar should fade out too.

Any suggestions on how to manage the Android ActionBar in PhoneGap - I've seen some other similar questions but generally asking how to show it, seems like getting it to hide is less popular?

After much searching I was able to determine that the phonegap fullscreen setting doesn't necessarily give way to full "immersive" mode by default. After adding the plugin cordova-plugin-fullscreen and setting the immersive mode from the plugin, I was able to resolve this issue.

https://www.npmjs.com/package/cordova-plugin-fullscreen

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