无法在软键盘上方显示PopupWindow

时间:2015-11-26 03:53:28

标签: android android-layout

PopupWindow中有一个方法:

public void showAtLocation(View parent, int gravity, int x, int y)

在大多数设备上,我可以在屏幕底部放置一个PopupWindow,甚至键盘也是打开的,如下所示:

showAtLocation( rootView, Gravity.Bottom, 0, 0 )

但有些设备有例外, 例如Xperia Z1 comapct,ASUS Zenfone 5。 PopupWindow的可用空间受到限制。 (键盘外)

有人面临同样的问题吗? 或任何建议?

1 个答案:

答案 0 :(得分:1)

PopupWindow上添加这两种输入模式:

popupWindow.setSoftInputMode(PopupWindow.INPUT_METHOD_NEEDED);
popupWindow.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
相关问题