private void hideKeyBord(View view){//这个view我传的是popwindow的view
InputMethodManager inputMgr = (InputMethodManager) getContext()
.getSystemService(Context.INPUT_METHOD_SERVICE);
inputMgr.hideSoftInputFromWindow(view.getWindowToken(),0);//这个是隐藏输入法
// inputMgr.toggleSoftInput(InputMethodManager.HIDE_NOT_ALWAYS, 0);//这个是输入法切换,当输入法显示了就隐藏输入法,当输入法隐藏了就显示.
}
Android隐藏输入法 【有效】
最新推荐文章于 2023-10-13 10:13:37 发布