如何以编程方式在Android中禁用拼写更正 [英] how to disable spell correction programmatically in android
本文介绍了如何以编程方式在Android中禁用拼写更正的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何以编程方式停用拼写校正的Android?用户可以通过设置来禁用它,但我需要在我的应用程序禁用它。
How can I disable the spell correction programmatically in android? User can disable it from settings, but I need disable it in my application.
有没有办法做到这一点?
Is there any way to do this?
推荐答案
设置这个在布局的XML为您的EditText:
Set this in your layout's xml for your EditText:
安卓inputType =textNoSuggestions
或呼叫 setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS)
在你的活动
如果您需要支持的API 4及以下,使用安卓inputType =为TextFilter
If you need to support API 4 and below, use android:inputType="textFilter"
这篇关于如何以编程方式在Android中禁用拼写更正的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文