PhoneGap的+ Android 4.4的:如何当SoftKeyBoard隐藏检测? [英] Phonegap + Android 4.4: How to detect when the SoftKeyBoard hides?

查看:130
本文介绍了PhoneGap的+ Android 4.4的:如何当SoftKeyBoard隐藏检测?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试添加一个事件侦听器来检测softkeyboard皮的时候,却不起作用!

I tried to add a event listener to detect when the softkeyboard hides, but it doesn't work!

我想这code:

    document.addEventListener('deviceready', function() {           
       document.addEventListener("hidekeyboard", function() {
           alert('hidekeyboard!');
       }, false);
    }, false);

我试图检测它而输入损失的焦点,但在软键盘的皮,所述输入元件仍然焦点..

I tried to detect it while a input losses the focus, but when the soft keyboard hides, the input element still remains the focus..

在此先感谢!

推荐答案

我找到了解决我的问题。的问题是,'hidekeyboard'事件从未被PhoneGap的由于这样的事实,该网页视图有错误并且是静态的(对softkeyboard被触发时,它从未调整大小)来触发。随着web视图调整大小从来没有,从来没有被触发事件。

I found the solution to my problem. The problem was that the 'hidekeyboard' event was never triggered by Phonegap due to the fact that the webview had errors and was static (it never resizes when the softkeyboard was triggered). As the webview never resizes, the event never is triggered.

我们可以找到事件类中的LinearLayoutSoftKeyboardDetect触发。

We can find the triggering of the event in the class LinearLayoutSoftKeyboardDetect.

感谢所有!

这篇关于PhoneGap的+ Android 4.4的:如何当SoftKeyBoard隐藏检测?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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