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.
Related Topics
How to Get the Current Gps Location Programmatically in Android
Onactivityresult Is Not Being Called in Fragment
How to Declare Global Variables in Android
How to Add a Library Project to Android Studio
Change App Language Programmatically in Android
How to Use Localbroadcastmanager
Best Practice For Instantiating a New Android Fragment
Activity Restart on Rotation Android
Can't Create Handler Inside Thread That Has Not Called Looper.Prepare()
How to Get the Result of Onpostexecute() to Main Activity Because Asynctask Is a Separate Class
You Need to Use a Theme.Appcompat Theme (Or Descendant) With This Activity
Android Prevent Immediate Trigger of Alarm Service If Alarm Time Has Passed For the Day
Android Button Background Is Taking the Primary Color
Onmeasure Custom View Explanation
How to Enable/Disable Log Levels in Android