问题描述
Android中是否有一种方法可以检测屏幕上是否可以看到软件键盘(又称软"键盘)?
Is there a way in Android to detect if the software (a.k.a. "soft") keyboard is visible on screen?
推荐答案
没有直接方法-请参见 http://groups.google.com/group/android-platform/browse_thread/thread/1728f26f2334c060/5e4910f0d9eb898a 来自Android小组的Dianne Hackborn进行了回复.但是,您可以通过检查#onMeasure中的窗口大小是否更改来间接检测到它.请参阅如何检查Android中软件键盘的可见性?.
There is no direct way - see http://groups.google.com/group/android-platform/browse_thread/thread/1728f26f2334c060/5e4910f0d9eb898a where Dianne Hackborn from the Android team has replied. However, you can detect it indirectly by checking if the window size changed in #onMeasure. See How to check visibility of software keyboard in Android?.
这篇关于如何检测Android设备上是否可见软件键盘?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!