How to Remove Android Auto-Suggest Underlining in Edittext

How to remove Android auto-suggest underlining in EditText?

Use this just before you getText(). This is the most straightforward and the official way.

 edittext.clearComposingText();

How to remove the underline from the EditText field in Android?

You don't have to use any logic to remove the underlines -- just call getText().toString() when you want to use the value. It won't include special formatting or anything.

Remove the underline when typing word in EditText

As outlined at Android edittext is underlined when typing, this may be a function of the keyboard in use, rather than the EditText. Without knowing which specific solutions you've tried and have failed (you say no answer worked for you, but don't list things you tried) it is hard to offer a specific suggestion, but I'd suggest the

android:inputType="textVisiblePassword|textNoSuggestions"

option and see if that works. The password should typically prevent the keyboard from suggesting things (since no suggestions are typically useful for passwords).

How to remove underline below EditText indicator?

Make background like this
android:background="@null" of your editText

Android - Remove totally underline from EditText

SOLUTION TO SOLVE THE PROBLEMS WITH MY EditText

Finally, I found a solution to solve the problem of my EditText. I put it here because I think it could be helpful to another people. I'm going to divide the problem in two solutions.

First of all, how to remove the white block at the bottom of my layout.

As N.T said (Thanks!), I just have to change my android:layout_height of my yellow layout to match_parent.

Second one, how to make my EditText not to be so reduced.

I just have to remove these attributes:

android:width="150dp"
android:height="50dp"

And add these others:

android:inputType="textCapSentences|textMultiLine|textNoSuggestions"
android:minLines="2"

So the full EditText now it's as follows:

<EditText
android:id="@+id/txtName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="15dp"
android:text=""
android:hint="Name"
android:inputType="textCapSentences|textMultiLine|textNoSuggestions"
android:minLines="2"
android:background="@drawable/rounded_corners" />

SOLUTION TO TOTALLY STOP THE UNDERLINE

You have to add textVisiblePassword to your inputType. With this value you only will be able to type letters one by one, so the underline won't appear.

It don't let you to use Swype mode to type words, so the underline never appears.

The inputType have to be like:

android:inputType="textCapSentences|textMultiLine|textNoSuggestions|textVisiblePassword"

Remove edittext indicator (underline) - Material Design

Try adding boxStrokeWidthFocused to your style

<style name="EditTextLoginRegister" parent="Widget.MaterialComponents.TextInputLayout.FilledBox">
<!-- Other attributes -->
<item name="boxStrokeWidthFocused">0dp</item>

</style>

Admittedly, this is the most difficult part -> styling Material design views.
In Android Studio, it is possible to get AutoComplete options, and I usually go through the complete list and try out various items.

Sample Image



Related Topics



Leave a reply



Submit