【发布时间】:2013-03-03 21:33:48
【问题描述】:
我想在按钮的点击事件中隐藏键盘。任何帮助将不胜感激
【问题讨论】:
我想在按钮的点击事件中隐藏键盘。任何帮助将不胜感激
【问题讨论】:
InputMethodManager inputManager = (InputMethodManager)
getSystemService(Context.INPUT_METHOD_SERVICE);
inputManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(),
InputMethodManager.HIDE_NOT_ALWAYS);
我把它放在 onClick(View v) 事件之后。
你需要import android.view.inputmethod.InputMethodManager;
点击按钮时键盘隐藏。
【讨论】:
隐藏虚拟键盘:
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(editView.getWindowToken(), 0);
【讨论】: