Android soft keyboard will hide for no reason(Android软键盘会无故隐藏)
问题描述
我遇到以下问题 - 我已放置
I'm having the following issue - I have placed
android:windowSoftInputMode = "stateAlwaysVisible"
在我的清单中,由于软件键盘几乎始终可见,因此效果相对较好.我有一个 webview,其中有一个可编辑的 div,用户可以在其中输入文本.但是,当用户输入一些文本并在 webview 上的其他位置(在与当前光标位置不同的位置)点击时,软件键盘将隐藏片刻,然后重新出现.我束手无策,找不到对此的解释.使用 InputMethodManager 使键盘始终可见也无济于事.
in my manifest which works relatively fine since the software keyboard is almost always visible. I have a webview in which I have an editable div in which the user can enter text. However when the user have entered some text and taps somewhere else on the webview(on a position different from the current cursor position) the software keyboard will hide for a moment and afterwards reappear. I'm at my wits end and can't find an explanation for this. Using InputMethodManager to make the keyboard always visible also didn't help.
我们将不胜感激任何帮助.谢谢!
Any help will be greatly appereciated. Thanks!
推荐答案
问题是键盘隐藏了,因为我们通过 loadUrl("javascript : bar(event.getX(), event.getY()));"
.
The issue was that the keyboard is hiding due to the fact that we were passing all the touch events down to javascript we are having via loadUrl("javascript : bar(event.getX(), event.getY()));"
.
原来 loadUrl
方法在内部隐藏了软件键盘.我通过不将触摸事件传递给javascript来解决这个问题,而是使用 window.onmousemove
Turns out the loadUrl
method internally hides the software keyboard. I worked this around by not passing the touch events to the javascript, but instead by using window.onmousemove
这篇关于Android软键盘会无故隐藏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Android软键盘会无故隐藏


- 如何检查发送到 Android 应用程序的 Firebase 消息的传递状态? 2022-01-01
- 使用自定义动画时在 iOS9 上忽略 edgesForExtendedLayout 2022-01-01
- Android - 拆分 Drawable 2022-01-01
- MalformedJsonException:在第1行第1列路径中使用JsonReader.setLenient(True)接受格式错误的JSON 2022-01-01
- android 4中的android RadioButton问题 2022-01-01
- Android - 我如何找出用户有多少未读电子邮件? 2022-01-01
- Android viewpager检测滑动超出范围 2022-01-01
- 用 Swift 实现 UITextFieldDelegate 2022-01-01
- 在测试浓缩咖啡时,Android设备不会在屏幕上启动活动 2022-01-01
- 想使用ViewPager,无法识别android.support.*? 2022-01-01