Search code examples
javaandroidandroid-layoutandroid-edittextmaterial-design

How to remove border of material.textfield.TextInputEditText (Material EditText)


can't remove the bottom border of Material Edit Text.

here is the code I've tried:

<com.google.android.material.textfield.TextInputLayout
            android:layout_width="200dp"
            android:layout_height="50dp"
            android:layout_marginBottom="40dp"
            app:passwordToggleEnabled="true">

            <com.google.android.material.textfield.TextInputEditText
                android:id="@+id/register_password"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:inputType="textPassword"
                android:background="#00000000"
                android:textSize="14sp" />

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

Output is:Edit Text


Solution

  • I've managed to remove the bottom line. thanks all

                        <com.google.android.material.textfield.TextInputLayout
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_marginEnd="5dp"
                        android:layout_marginBottom="2dp"
                        android:hint=" "
                        style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
                        >
    
                        <com.google.android.material.textfield.TextInputEditText
                            android:id="@+id/usernameEditText"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:gravity="center_vertical"
                            android:inputType="text"
                            android:maxLines="1"
                            android:hint="Username"
                            android:background="#00000000"
                            android:textSize="14sp" />
    
                    </com.google.android.material.textfield.TextInputLayout>