我在 Linearlayout 中有两个 EditText 视图和一个按钮。在编辑文本中写入完成后,我想隐藏Android虚拟键盘,我该怎么做?
您可以像这样使用 InputMethodManager 类:
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow( yourEditText.getWindowToken(),InputMethodManager.RESULT_UNCHANGED_SHOWN);
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)