PopupWindow以上虚拟键盘 [英] PopupWindow above Virtual keyboard

查看:144
本文介绍了PopupWindow以上虚拟键盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个PopupWindow,在用户输入EditText时显示。这个弹出窗口为他提供了一些建议。
我的问题是,当弹出窗口显示时,它的一部分显示在屏幕上的键盘上,阻止用户继续键入。
有谁知道这种行为的原因以及如何解决?

I have a PopupWindow that is shown when a user is typing in an EditText. This popup offers him some suggestions. My problem is that when the Popup is shown, a part of it is displayed over the Keyboard on the screen, preventing the user to continue typing. Does anyone know why of this behaviour and how could I fix it?

推荐答案

将弹出窗口放在软键盘后面只需设置此行:

To have your popupwindow behind the softkeyboard just set this line:

popupWindow.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);

以及

popupWindow.setFocusable(false);
popupWindow.setOutsideTouchable(false);

这篇关于PopupWindow以上虚拟键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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