@Override public boolean onTouchEvent(MotionEvent event) { //点击空白区域,软键盘消失 if (event.getAction() == MotionEvent.ACTION_DOWN && getCurrentFocus() != null && getCurrentFocus().getWindowToken() != null) { InputMethodManager mInputMethodManager = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE); mInputMethodManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); } return super.onTouchEvent(event); }
点击空白区域,软键盘消失
最新推荐文章于 2019-11-13 16:20:45 发布