Skip to content Skip to sidebar Skip to footer

How Can Remove Underline From TextInputLayout Or TextInputEditText

I want remove underline. This is my code: Copy

or

android:background="@null"

you can also see this answer


Solution 2:

just add android:background="" inside TextInputEditText


Solution 3:

You can also create a layout file for the background you wish and set it as: android:background="@layout/nameoffile"


Solution 4:

You can set below attributes in TextInputLayout to have no width

app:boxStrokeWidth="0dp"
app:boxStrokeWidthFocused="0dp"

Your layout

<com.google.android.material.textfield.TextInputLayout
    android:id="@+id/textInputLayoutName"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="60dp"
    android:layout_marginStart="5dp"
    android:layout_marginEnd="5dp"
    app:boxCornerRadiusTopStart="20dp"
    app:boxCornerRadiusTopEnd="20dp"
    app:boxStrokeWidth="0dp"
    app:boxStrokeWidthFocused="0dp"
    app:boxCornerRadiusBottomEnd="20dp"
    app:boxCornerRadiusBottomStart="20dp">

    <com.google.android.material.textfield.TextInputEditText
        android:id="@+id/textInputEditTextName"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="@string/register_hint_name"
        android:inputType="text"
        android:textColor="@color/black" />

</com.google.android.material.textfield.TextInputLayout>

Preview

enter image description here


Post a Comment for "How Can Remove Underline From TextInputLayout Or TextInputEditText"