Home > Enterprise >  How to remove textinputlayout background
How to remove textinputlayout background

Time:01-16

I have a textinputlayout on an white background but the background seems greyish .how can i remove this effect

 <com.google.android.material.textfield.TextInputLayout
            android:layout_width="match_parent"
            android:layout_marginTop="@dimen/vertical_field_spacing"
            android:layout_height="wrap_content"
            
            android:background="@null"
            android:layout_gravity="left"
            android:orientation="horizontal">


            <EditText
                android:gravity="left"
                android:layout_width="match_parent"
                android:inputType="textEmailAddress"
                android:layout_height="wrap_content"
                android:hint="Email"/>

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

CodePudding user response:

You could remove the background by setting it to transparent this way:

<com.google.android.material.textfield.TextInputLayout
            android:layout_width="match_parent"
            android:layout_marginTop="@dimen/vertical_field_spacing"
            android:layout_height="wrap_content"
            
            app:boxBackgroundColor="@android:color/transparent"
            android:background="@android:color/transparent"
            android:layout_gravity="left"
            android:orientation="horizontal">


            <EditText
                android:gravity="left"
                android:layout_width="match_parent"
                android:background="@null"
                android:inputType="textEmailAddress"
                android:layout_height="wrap_content"
                android:hint="Email"/>

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

Note these two lines :

app:boxBackgroundColor="@android:color/transparent"
            android:background="@android:color/transparent"
  •  Tags:  
  • Related