I have an android screen which takes email from the user. Below is the snippet of the code, I want to remove the underline which appears below the text.
<
It looks like the Material Components library draws its own underline using app:boxStrokeColor. This attribute is a ColorStateList, so you have to create a color state list resource in which all states' colors are set to transparent. So basically you want to create a new file res/color/filename.xml:
and set the app:boxStrokeColor attribute to @color/filename.
However, this left me with a black underline which still doesn't respond to android:background=@null or .
Quickfix: if you set the TextInputLayout outlined using style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox", the box looks almost the same, but the underline is gone. In order to remove the stroke just set the app:boxStrokeColor attribute to @null.