如何在输入文本时抑制字典提示?
输入密码(或任何其他文本字段)时,我遇到了字典提示。我是这样做的:
editText.setInputType(InputType.TYPE_CLASS_TEXT |
InputType.TYPE_TEXT_VARIATION_PASSWORD |
InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
但无论如何,当用户选择键盘预测为“打开”时 - 在输入密码期间,它会显示字典提示,这对于密码来说是愚蠢的!
我做错了什么?
I am stuck with dictionary hints while entering password (or any other text field). I am doing it in this way:
editText.setInputType(InputType.TYPE_CLASS_TEXT |
InputType.TYPE_TEXT_VARIATION_PASSWORD |
InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
But anyway when user selects keyboard predictions as "on" - during password entering it shows dictionary hints, which is stupid for passwords!
What I'm doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
更多信息在这里: http://developer.android.com/reference/android /R.styleable.html#AutoCompleteTextView_inputType
使用 IME 选项编辑文本。
有关输入类型的更多信息:
http://developer.android.com/reference/android/widget /TextView.html#attr_android:inputMethod
另外请看一下这里 http://groups.google.com/group/android-developers /browse_thread/thread/d3c055137498bbc9?pli=1
More Info Here: http://developer.android.com/reference/android/R.styleable.html#AutoCompleteTextView_inputType
Use the IME Options for the Edit text.
More about Input Types:
http://developer.android.com/reference/android/widget/TextView.html#attr_android:inputMethod
Also Do take a Look at here http://groups.google.com/group/android-developers/browse_thread/thread/d3c055137498bbc9?pli=1
您必须使用
setTransformationMethod()
方法,如下所示:android.text.method.TransformationMethod
或者也可以在布局 XML 中将
android:password
值设置为true
,如下所示:You have to use the
setTransformationMethod()
method like this:android.text.method.TransformationMethod
Or whats also possible is to set the
android:password
value totrue
in your layout XML like this:一探究竟!
参考:https://developer.android.com/reference/android/R。 styleable#AutoCompleteTextView_inputType
1: https://i.sstatic.net/ULX2a.png 看图片
XML:
爪哇
Check it out!
reference: https://developer.android.com/reference/android/R.styleable#AutoCompleteTextView_inputType
1: https://i.sstatic.net/ULX2a.png See the picture
XML:
JAVA