[英]Android - Cordova/PhoneGap - Keyboard Shows on Load & on Resume from Background
I have a Cordova (3.3.0)/PhoneGap application I am building. 我有一个正在构建的Cordova(3.3.0)/ PhoneGap应用程序。
I am having several issues with the keyboard showing in the Android version (issue does not occur on iOS): 我在Android版本中显示键盘时遇到了几个问题(在iOS上不会发生此问题):
Any insight to why this might be? 对为什么会这样有任何见解?
I have the following value in my config.xml (in the root www folder): 我的config.xml(在根www文件夹中)具有以下值:
<preference value="true" name="KeyboardShrinksView"/>
Some other info that might be relevant: 其他一些可能相关的信息:
<div>
to avoid confusion), but as far as I can tell, this input does not gain focus. <div>
),但是据我所知,此输入没有获得焦点。 I have confirmed this with javascript alerts. Thank you in advance for your time and efforts! 预先感谢您的时间和精力!
Was able to fix my own bug. 能够修复我自己的错误。 It had to do with the AndroidManifest.xml configuration, and not anything Cordova/Phonegap related.
它与AndroidManifest.xml配置有关,与Cordova / Phonegap没有任何关系。 Specifically the
具体来说
android:windowSoftInputMode="stateVisible|adjustPan"
attribute on the activity declaration. 活动声明中的属性。 I can't remember where I found the suggestion for
stateVisible
, but I believe it was leftover from working through some other keyboard issues. 我不记得在哪里找到有关
stateVisible
的建议,但我认为它是解决其他键盘问题后遗留下来的。 I adjusted the value to 我将值调整为
android:windowSoftInputMode="stateHidden|adjustPan"
and it fixed the problem. 它解决了这个问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.