三星的 InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS [英] InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS in Samsung
问题描述
在我的应用程序中,我有一个 EditText
,带有一个用于更改键盘输入类型的按钮.代码:
In my app, I have an EditText
, with a button to change the keyboard input type. The code:
ToggleCambiarTeclado.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
if (ToggleCambiarTeclado.isChecked()) {
tipoDeTecladoActual = InputType.TYPE_CLASS_NUMBER;
imagenTeclado.setImageDrawable(getResources().getDrawable(R.drawable.keyboard_numeric));
} else {
tipoDeTecladoActual = InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS;
imagenTeclado.setImageDrawable(getResources().getDrawable(R.drawable.keyboard_querty));
}
editNumeroContador.setInputType(tipoDeTecladoActual);
}
});
它在我的手机上运行良好……但我老板有一台三星手机,并且没有改变他手机的键盘类型.
It works perfectly in my phone...but my boss has a Samsung, and is not changing the keyboard type in his phone.
我尝试将其更改为 TYPE_TEXT_VARIATION_NORMAL
、TYPE_TEXT_VARIATION_VISIBLE_PASSWORD
和 YPE_CLASS_TEXT
,但它们都不起作用.
I have tried changing it to TYPE_TEXT_VARIATION_NORMAL
, TYPE_TEXT_VARIATION_VISIBLE_PASSWORD
and YPE_CLASS_TEXT
, neither of them are working.
有谁知道这是否是一个错误?任何已知的解决方法?
Anyone knows if this is a bug? Any known workaround?
谢谢.
刚刚发现我的老板安装了触宝.如果他将默认键盘更改为标准键盘,它就可以完美运行...
Just realized my boss has TouchPal installed. If he changes the default keyboard to the standard it works perfectly...
推荐答案
后来的三星设备内置了 SwiftKey 键盘.SwiftKey 在某些时候有意决定忽略 Android 的 InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS
.
Later Samsung devices have SwiftKey keyboards built in. SwiftKey intentionally decided at some point to ignore Android's InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS
.
一种解决方法是使用 InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD
,这有点笨拙,但不幸的是一种常见的解决方法.
A workaround is to use InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD
, which is somewhat hacky, but an unfortunately common workaround.
XML 变体:android:inputType="textVisiblePassword"
这篇关于三星的 InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!