EditText上没有自动校正等 [英] EditText without auto-correction, etc

查看:97
本文介绍了EditText上没有自动校正等的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的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);

有关的所有可用的输入类型选项看到一个列表 <一href="http://developer.android.com/reference/android/text/InputType.html">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

这篇关于EditText上没有自动校正等的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆