简体   繁体   English

带有textPassword inputType的EditText,但没有软键盘

[英]EditText with textPassword inputType, but without Softkeyboard

i wanted to create an EditText with an android:inputType="textPassword. However i also do not want to use the SoftKeyboard for input. 我想使用android:inputType =“ textPassword创建一个EditText。但是我也不想使用SoftKeyboard进行输入。

So i tried setting InputMethod to null, but this would also disable the textPassword features of replacing password rendering to " * [lastchar]". 因此,我尝试将InputMethod设置为null,但这也将禁用将密码呈现替换为“ * [lastchar]”的textPassword功能。

Is there any other way to disable the softKeyboard from showing up? 还有其他方法可以禁止softKeyboard显示吗?

Uhm just figured it out myself: 乌姆自己想通了:

Simply use: 只需使用:

pinInput.setOnClickListener(new OnClickListener() {
      public void onClick(View v) {
            InputMethodManager mgr = (InputMethodManager) Pin.this.getSystemService(Context.INPUT_METHOD_SERVICE);
            mgr.hideSoftInputFromWindow(v.getWindowToken(), 0);
      }
    });

This works well for me. 这对我来说很好。 I feared it might show the SoftKeyboard and then hide it again instantly, or flicker the screen, but does nothing like it. 我担心它可能会显示SoftKeyboard,然后立即将其再次隐藏,或使屏幕闪烁,但是却无济于事。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 EditText的Inputtype textPassword允许使用whatspaces - Inputtype textPassword for EditText allows whatspaces 将AdjustPan与EditText inputType =“ textPassword”结合使用可覆盖EditText的一部分 - adjustPan combined with EditText inputType=“textPassword” covers a portion of the EditText android edittext inputType:textpassword在某些设备上不能与intputType:actionDone一起使用 - android edittext inputType:textpassword not working with intputType:actionDone on some devices 使用 inputType=textPassword 在 EditText 上调用 setSingleLine 使字符可见 - Calling setSingleLine on an EditText with inputType=textPassword make characters visible 如何在Android中将inputType设置为textPassword的EditText设置样式提示 - How to style hint for EditText with inputType set to textPassword in Android 如何在当前inputType为“ textPassword”的EditText中显示密码? - How to show password in an EditText where current inputType is “textPassword”? 当inputType =“textpassword”时,EditText提示显示额外的空格 - EditText hint shows extra spaces when inputType=“textpassword” "在android中如何显示星号(*)代替EditText中的点,输入类型为textPassword?" - In android how to show asterisk (*) in place of dots in EditText having inputtype as textPassword? EditTextPreference inputType=textPassword 不起作用 - EditTextPreference inputType=textPassword not working Android如何使用InputType =“ text”的EditText显示数字软键盘 - Android How to show numeric softkeyboard with EditText of InputType=“text”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM