[英]Inputtype textPassword for EditText allows whatspaces
[英]EditText with textPassword inputType, but without Softkeyboard
我想使用android:inputType =“ textPassword创建一个EditText。但是我也不想使用SoftKeyboard进行输入。
因此,我尝试将InputMethod设置为null,但这也将禁用将密码呈现替换为“ * [lastchar]”的textPassword功能。
还有其他方法可以禁止softKeyboard显示吗?
乌姆自己想通了:
只需使用:
pinInput.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
InputMethodManager mgr = (InputMethodManager) Pin.this.getSystemService(Context.INPUT_METHOD_SERVICE);
mgr.hideSoftInputFromWindow(v.getWindowToken(), 0);
}
});
这对我来说很好。 我担心它可能会显示SoftKeyboard,然后立即将其再次隐藏,或使屏幕闪烁,但是却无济于事。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.