Android的软键盘会隐藏无缘无故 [英] Android soft keyboard will hide for no reason

查看:137
本文介绍了Android的软键盘会隐藏无缘无故的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下问题 - 我已经把

I'm having the following issue - I have placed

android:windowSoftInputMode = "stateAlwaysVisible"

在我的清单中,因为软件键盘的几乎总是可见它的工作原理比较精细。我有一个web视图中,我有一个可编辑的div中,用户可以输入文本。然而,当用户输入一些文字和水龙头其他地方上的web视图(从当前光标所在位置不同的位置)软键盘会隐藏了一会儿,之后重新出现。我在我束手无策,无法找到此解释。使用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.

任何帮助将大大appereciated。谢谢!

Any help will be greatly appereciated. Thanks!

推荐答案

问题是,键盘是隐藏由于这样的事实,我们是通过通过所有的触摸事件下的JavaScript我们有使用loadURL(JavaScript的:巴(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的软键盘会隐藏无缘无故的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆