3

XML:

<com.google.android.material.textfield.TextInputLayout
    android:id="@+id/name_inputLayout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginHorizontal="16dp"
    app:endIconMode="clear_text"
    app:hintEnabled="false">

    <com.google.android.material.textfield.TextInputEditText
        android:id="@+id/name_editText"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="Name"
        android:inputType="text"
        android:paddingHorizontal="40dp"/>

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

Result:

enter image description here

Workaround: I have to use paddingStart and paddingEnd to achieve the same effect.

2
  • Please clearly state where you want to apply the padding. Commented 12 hours ago
  • 1
    Hii, PaddingHorizontal will not work with Material TextInputEditText due to the internal layout is implemented. Commented 6 hours ago

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.