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?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
To have your popupwindow behind the softkeyboard just set this line:
popupWindow.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
and also
popupWindow.setFocusable(false);
popupWindow.setOutsideTouchable(false);
回答2:
try this
popupWindow = new PopupWindow(popupView, WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.WRAP_CONTENT,true);
回答3:
try using
PopupWindow.showAtLocation(View parent, int gravity, int x, int y)
instead of
PopupWindow.showAsDropDown (View anchor)
回答4:
popupWindow.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
This is working with lollipop