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软键盘会无故隐藏
基础教程推荐
- 当从同一个组件调用时,两个 IBAction 触发的顺序是什么? 2022-01-01
- 如何在没有IB的情况下将2个按钮添加到右侧的UINavigationbar? 2022-01-01
- 如何在 UIImageView 中异步加载图像? 2022-01-01
- Kivy Buildozer 无法构建 apk,命令失败:./distribute.sh -m “kivy"d 2022-01-01
- UIWebView 委托方法 shouldStartLoadWithRequest:在 WKWebView 中等效? 2022-01-01
- Android:对话框关闭而不调用关闭 2022-01-01
- android 应用程序已发布,但在 google play 中找不到 2022-01-01
- 在 gmail 中为 ios 应用程序检索朋友的朋友 2022-01-01
- 如何在 iPhone 上显示来自 API 的 HTML 文本? 2022-01-01
- 如何让对象对 Cocos2D 中的触摸做出反应? 2022-01-01