【问题标题】:How to hide Android Soft Keyboard? [duplicate]如何隐藏安卓软键盘? [复制]
【发布时间】:2014-04-19 16:52:28
【问题描述】:

我在 Linearlayout 中有两个 EditText 视图和一个按钮。在edittext中写入完成后,我想隐藏Android虚拟键盘,我该怎么做?

【问题讨论】:

  • 最好关闭而不是投反对票??

标签: android android-edittext android-softkeyboard android-virtual-keyboard


【解决方案1】:

你可以像这样使用 InputMethodManager 类:

InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow( yourEditText.getWindowToken(),InputMethodManager.RESULT_UNCHANGED_SHOWN);

【讨论】:

    猜你喜欢
    • 2023-01-09
    • 2012-06-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-13
    • 1970-01-01
    • 2011-12-24
    相关资源
    最近更新 更多