android - avoid text to be underlined in EditText - android

When I write a text in an EditText it gets underline until I hit the space key. I've tried:
android:inputType="textNoSuggestions"
But it's not helping

If you are talking about the default 'underlining' of EditText, try setting its background to transparent.

try to add following lines in java code-
mEditText.setHorizontallyScrolling(true);
mEditText.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
If you need to support API 4 and below, use android:inputType="textFilter"

Related

how to hide underline in editText when input type is text in android

how to hide underline when entering text in edit text?
given inputType = text, I'm able to see the line coming under words and giving space and entering the next word line in the first word disappears. Is this a default behaviour? when inputType is given as android:inputType="text|textVisiblePassword"
when entering characters line is not visible can any one suggest me text|textVisiblePassword is correct to use for edit text to make the line disappear?
android:inputType="textNoSuggestions"
You have to disable a spelling checker in edittext using this code :
android:inputType="textNoSuggestions"
From xml, disable a spelling checker in edittext:
android:inputType="textNoSuggestions"
OR
Programmatically you can use:
editText.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
Apply this code in EditText XML.
android:background="#null"
enter image description here
Try this in XML :
android:inputType="textMultiLine"

How to remove the double underline from EditText? [duplicate]

How can I disable spelling corrections in an EditText's soft-keyboard programmatically in Android? The user can disable it from settings, but I need to disable it in my application.
Is there any way to do this?
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"

how to disable spellcheck Android edittext

I want to remove the underlines from texts inside edittext fields.
How can I do that?
You can do it with following code. Just paste it in layout of EditText.
android:inputType="textNoSuggestions"
In order to get rid of spell checking you have to specify the EditText's InputType in the XML as the following:
android:inputType="textNoSuggestions"
However, if your EditText is multiline and also you need to get rid of spell checking,then you have to specify the EditText's InputType in the XML as the following:
android:inputType="textMultiLine|textNoSuggestions"
Minor addition to Chintan's answer - such (and other) combination is also allowed:
android:inputType="textCapSentences|textNoSuggestions"
Or if you want to just disable the red underline (and the autocorrect dialog), you can override the isSuggestionsEnabled() method on TextView.
This will keep the keyboard autocomplete working.
I just Added a line in for EditText
editText.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
and it worked fine for me.
So I was not able to find out any direct way of doing it. So went ahead with below workaround:
editText.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);
As the input type becomes a visible password, even if the spell check is enabled from the device settings, the Red underline won't appear. :)

How to set multiline,firstletter caps and disable suggestions on edittext

I have an edittext for reply to email. i want to give three properties for edittext like Multiline, First character caps and disable word suggestions.
I gave like this in xml...
android:inputType="textCapSentences|textVisiblePassword"
I tried in code also... etMessage.setInputType(InputType.TYPE_TEXT_FLAG_MULTI_LINE|InputType.TYPE_TEXT_FLAG_CAP_SENTENCES);
I am not able to give multiline....how can i achieve this
thanks
I found solution for this problem
Just set the following parameters in xml file..
android:inputType="textCapSentences|textVisiblePassword"
These are for setting first letter of sentence to caps and disable suggestions
and write following code in ur Activity
edittext.setSingleLine(false);
Try setting android:inputType="textMultiLine|textCapSentences|textVisiblePassword". What might be happening is that it is multiline but only one line is currently shown, in which you could say android:minLines="5" or so.

Android EditText pre filled text

working on an application
i need to take an EditText.
but i need as in the phone :-
The EditText already contains blurred text such as "Your Name" when you start typing the text vanishes and you text is shown. I hope you've seen this effect/property..
I'm not getting what this property is called to be searched on google...
Hint
http://developer.android.com/reference/android/widget/TextView.html#attr_android:hint
Use the following in your layout.xml file of edittext:
android:hint="Here your hint text"

Categories

Resources