0
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="@dimen/textinput_container_height"
app:errorEnabled="true"
app:errorTextAppearance="@style/TextAppearance.AppCompat.Small.ErrorStyle"
tools:hint="@string/ip_printers">

<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="-5dp"
app:errorTextAppearance="@style/TextAppearance.AppCompat.Small.ErrorStyle"
tools:text="1234567890" />

</android.support.design.widget.TextInputLayout>

This my code. How I can remove padding to error text? img with error img with error

  • 1
    Possible duplicate of [How to disable padding on TextInputLayout?](https://stackoverflow.com/questions/41403193/how-to-disable-padding-on-textinputlayout) – AskNilesh Mar 22 '18 at 12:30
  • https://stackoverflow.com/questions/43541740/removing-textinputlayout-extra-top-padding – AskNilesh Mar 22 '18 at 12:30
  • https://stackoverflow.com/questions/34917677/textinputlayout-error-text-padding – AskNilesh Mar 22 '18 at 12:31

2 Answers2

-2

You have to remove this line

android:layout_marginStart="-5dp"

or

if you need that margin, please give in parentView -android.support.design.widget.TextInputLayout

like

<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="@dimen/textinput_container_height"
app:errorEnabled="true"
app:errorTextAppearance="@style/TextAppearance.AppCompat.Small.ErrorStyle"
tools:hint="@string/ip_printers"
android:layout_marginStart="-5dp">
Raja
  • 2,775
  • 2
  • 19
  • 31
-3

TextInputLayout is a LinearLayout, so you should be able to specify a negative margin or padding, e.g.

android:layout_marginLeft="-2dp"    
android:layout_marginStart="-2dp"
AskNilesh
  • 67,701
  • 16
  • 123
  • 163