'Remove bottom line from TextInputEditText
I need to remove the bottom line of TextInputEditText I set background to transparent and null but nothing is working.
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_textinput_layout"
android:hint="@string/app_name">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/transparent"/>
</com.google.android.material.textfield.TextInputLayout>
The bg_textinput_layout
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/white"/>
<stroke android:width="@dimen/spacing_1"
android:color="@color/hint_text_color"/>
</shape>
Solution 1:[1]
You can apply app:boxStrokeWidth="0dp" and app:boxStrokeWidthFocused="0dp" (or theapp:boxStrokeColor attribute using a selector with the same values of the boxBackgroundColor).
<com.google.android.material.textfield.TextInputLayout
app:boxStrokeWidth="0dp"
app:boxStrokeWidthFocused="0dp"
...>
For a white box without background and border:
<com.google.android.material.textfield.TextInputLayout
app:boxStrokeWidth="0dp"
app:boxStrokeWidthFocused="0dp"
app:boxStrokeColor="#FFF"
app:boxBackgroundColor="#FFF"
...>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |


