How to disable spelling corrections programmatically in Android

删除回忆录丶 提交于 2019-11-27 14:21:26

Set this in your layout's xml for your EditText:

android:inputType="textNoSuggestions"

Or call setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS) in your Activity'

If you need to support API 4 and below, use android:inputType="textFilter"

If setting:

 android:inputType="textNoSuggestions" 

still doesn't work (and your text field is small), a quick work-around is to use:

 android:inputType="textVisiblePassword"
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!