首页 > 如何在PopupWindow中隐藏软键盘?

如何在PopupWindow中隐藏软键盘?

我的popupwindow里有一个edittext和一个button。
我想在软键盘弹出的时候,点击button隐藏键盘。
可是调用了隐藏键盘的方法(如下)后,键盘仍然没有隐藏,请问如何实现隐藏键盘:
InputMethodManager inputMethodManager = (InputMethodManager) mInputEt.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
inputMethodManager.hideSoftInputFromWindow(mInputEt.getApplicationWindowToken(), 0);



popupwindow和EditText的获取焦点的冲突。popupwindow有一个attribute: popupwindow.setfocusable(true);应该就可以了

【热门文章】
【热门文章】