【问题标题】:How to enable the softInput on the editText如何在editText上启用softInput
【发布时间】:2015-07-06 06:59:18
【问题描述】:

我使用

在我的 editText 上禁用了 softInput
public static void disableSoftInputFromAppearing(EditText editText) {
        editText.setRawInputType(InputType.TYPE_CLASS_TEXT);
        editText.setTextIsSelectable(true);
    }

但现在我不知道如何启用它。启用softInput的功能将不胜感激。

【问题讨论】:

    标签: android android-edittext window-soft-input-mode


    【解决方案1】:
    public void showSoftKeyboard(View view) {
        if (view.requestFocus()) {
            InputMethodManager imm = (InputMethodManager)
                    getSystemService(Context.INPUT_METHOD_SERVICE);
            imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT);
        }
    }
    

    来自this

    【讨论】:

      猜你喜欢
      • 2011-06-28
      • 1970-01-01
      • 2018-06-14
      • 1970-01-01
      • 2019-06-16
      • 1970-01-01
      • 1970-01-01
      • 2016-11-23
      相关资源
      最近更新 更多