Default Margin in material layout,

164 Views Asked by At

I'm trying to make a TextInputLayout , in which i took a TextInputEditText , but even after setting the TextInputEditText margin to 0 , there is a default margin inside the layout, idk why but kind of confused.

Screenshot for the problem

<com.google.android.material.textfield.TextInputLayout
        style="@style/Widget.MaterialComponents.Button.OutlinedButton"
        android:id="@+id/textInputLayout2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="Email Id"
        android:layout_marginLeft="40dp"
        android:layout_marginRight="40dp"
        app:layout_constraintBottom_toTopOf="@+id/TXTpassword"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/IMGlogo">

        <com.google.android.material.textfield.TextInputEditText
            android:id="@+id/TXTemail"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>
   </com.google.android.material.textfield.TextInputLayout>
1

There are 1 best solutions below

0
On

Try to use

android:insetBottom="0dp" 
android:insetTop="0dp"
android:insetRight="0dp"
android:insetLeft="0dp"