EditText上没有自动校正等EditText

2023-09-06 01:32:29 作者:巅峰小学生

我的EditText需要接受输入包括部分单词,姓名等至少在我的HTC Desire,这是困难的,因为键盘要建议和/或纠正某些条目(例如,更改为GOR到 )。我试图在视图中设置textNoSuggestions,但不能解决问题。

My EditText needs to accept input consisting of partial words, names, etc. At least on my HTC Desire, this is difficult since the keyboard wants to suggest and/or correct some entries (e.g., changes "gor" to "for"). I tried setting textNoSuggestions on the view, but that doesn't fix it.

任何简单的解决办法?

推荐答案

您可以从code做到这一点。设置的EditText的输入类型如下图所示:

You can do this from the code. Set the input type of the EditText like below:

txtEmail = (EditText) findViewById(R.id.txtEmail);
txtEmail.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);

有关的所有可用的输入类型选项看到一个列表 http://developer.android.com/reference/android/text/InputType.html

For a list of all the available input type options see http://developer.android.com/reference/android/text/InputType.html

 
精彩推荐
图片推荐