简体   繁体   English

软键盘关闭后,PhoneGap + Android页面不会刷新

[英]PhoneGap + Android page doesn't refresh after soft keyboard closes

Most of the time (but not always), when I finish typing in a or and the soft keyboard hides, the view area is left raised with a black space on the bottom. 在大多数情况下(但并非总是如此),当我输入或时,并且软键盘隐藏起来时,视图区域的底部会留有黑色空间。 Clicking, tilting or otherwise engaging the phone corrects the screen. 单击,倾斜或以其他方式接合手机可校正屏幕。 However, user's first motion is usually pressing , but if you click submit it jumps down and you actually just click on the text area again. 但是,用户的第一个动作通常是按,但是如果单击“提交”,则它会跳下来,实际上您只需再次单击文本区域即可。 How do you stop this and get the screen to reset after the keyboard closes. 键盘关闭后,如何停止此操作并让屏幕重置。

Take a look at you AndroidManifest.xml 看看你的AndroidManifest.xml

http://developer.android.com/guide/topics/manifest/activity-element.html http://developer.android.com/guide/topics/manifest/activity-element.html

I think you need to change android:configChanges . 我认为您需要更改android:configChanges

I have the exact same problem what i did was handle hidekeyboard even in javascript and do something like window.scrollTo(0,0) or $("input[type=text],textarea").blur(); 我有一个完全相同的问题,就是即使在javascript中也处理了hidekeyboard并做了诸如window.scrollTo(0,0)或$(“ input [type = text],textarea”)。blur();之类的问题。 This will cause the the screen to get back to normal position 这将导致屏幕回到正常位置

But there is just one problem when click from input field of type = text to a input field password it internally hide the keyboard which causes the hidekeyboard event to fire and scrolls the screen to top. 但是,当从type = text的输入字段单击输入字段密码时,它会在内部隐藏键盘,这会导致hidekeyboard事件触发并将屏幕滚动到顶部,这只是一个问题。 This is the only side effect of this 这是唯一的副作用

Let me know if you find the solution for this 让我知道您是否找到解决方案

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

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