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软键盘会无故隐藏
基础教程推荐
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
