当检测用户已经驳回了软键盘 [英] Detecting when user has dismissed the soft keyboard

查看:119
本文介绍了当检测用户已经驳回了软键盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个EditText小部件在我看来。当用户选择的EditText插件,我显示一些指示并且显示软键盘。

I have an EditText widget in my view. When the user selects the EditText widget, I display some instructions and the soft keyboard appears.

我用一个OnEditorActionListener来检测,当用户完成文本输入和我解​​雇了键盘,隐藏的指令并执行一些动作。

I use an OnEditorActionListener to detect when the user has completed text entry and I dismiss the keyboard, hide the instructions and perform some action.

我的问题是,当用户通过pressing BACK键驳回键盘。操作系统驳回键盘,但我的指示(我需要隐藏)仍然可见。

My problem is when the user dismisses the keyboard by pressing the BACK key. The OS dismisses the keyboard, but my instructions (which I need to hide) are still visible.

我已经试过压倒一切的onkeydown,但是这似乎并没有被调用时,BACK按钮用来关闭该键盘。

I've tried overriding OnKeyDown, but that doesn't seem to get called when the BACK button is used to dismiss the keyboard.

我试过设置上的EditText小部件的OnKeyListener,但似乎并没有得到或者叫做

I've tried setting an OnKeyListener on the EditText widget, but that doesn't seem to get called either.

如何检测时,软键盘被解雇?

How can I detect when the soft keyboard is being dismissed?

推荐答案

这个问题(没有答案了,看着严峻)似乎被问同样的问题:<一href="http://stackoverflow.com/questions/2150078/android-is-software-keyboard-shown">http://stackoverflow.com/questions/2150078/android-is-software-keyboard-shown

This question (with no answer yet and looking grim) seems the be asking the same question: http://stackoverflow.com/questions/2150078/android-is-software-keyboard-shown

这篇关于当检测用户已经驳回了软键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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