Disable spell check in TextView

3.4k Views Asked by At

I have many layouts in my app that use TextView to display some sentence fetched from back-end. The problem is, sometimes the text to be displayed contains some words which are not in the english dictionary, so I get a red underline beneath those words. This looks very bad. I have seen other SO posts regarding the same and people suggested to use :

android:inputType="textNoSuggestion"

in the xml of TextView. But, I get a warning from Android Studio that inputType should only be used for EditText or other similar views for input and I guess it is correct.

So, is there any TextView specific attribute that I can use for disabling the spell check? Is there any global setting I can put in the app that disables spell checking, because to refactor each TextView with some attribute seems a lot of work.

4

There are 4 best solutions below

3
maveroid On

Try using android:inputType="textVisiblePassword"

0
monika kapil On

Try this :

android:autoText="true"
0
c-an On

Okay, I had the same problem and found out the solution. Add this attribute to your TextView.

android:inputType="textFilter"

if this attribute already set to text then, change it.

Here is my reference: Turn off autosuggest for EditText?

0
Amirhosein Barati On

Try this

android:inputType="textNoSuggestions"