首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

暗藏键盘的一种处理方法

2013-10-22 
隐藏键盘的一种处理方法通过调用系统服务来隐藏键盘的一种处理方法:// 获取InputMethodManager实例InputMe

隐藏键盘的一种处理方法

通过调用系统服务来隐藏键盘的一种处理方法:

// 获取InputMethodManager实例InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);if (inputMethodManager != null) {// 获取当前Focus的ViewView currentFocus = getCurrentFocus();if (currentFocus != null) {// 隐藏键盘inputMethodManager.hideSoftInputFromWindow(currentFocus.getWindowToken(),InputMethodManager.HIDE_NOT_ALWAYS);}}

?

?

热点排行