我的popupwindow里有一个edittext和一个button。
我想在软键盘弹出的时候,点击button隐藏键盘。
可是调用了隐藏键盘的方法(如下)后,键盘仍然没有隐藏,请问如何实现隐藏键盘:
InputMethodManager inputMethodManager = (InputMethodManager) mInputEt.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
inputMethodManager.hideSoftInputFromWindow(mInputEt.getApplicationWindowToken(), 0);
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
popupwindow和EditText的获取焦点的冲突。popupwindow有一个attribute: popupwindow.setfocusable(true);应该就可以了