Text padding TextInputLayout

I am using TextInputLayout with AppCompatEditText with xml-based custom background for AppCompatEditText . Whenever I set some error, the error line starts at the beginning of the layout. Is there any way to complement this error line.

enter image description here

+4
source share
2 answers

You can reference the TextView error with:

TextView textView = (TextView) inputLayout.findViewById(android.support.design.R.id
            .textinput_error);

Then you can get your layout options for work.

+2
source
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
    android:id="@+id/tx_in_username"
    android:errorEnabled="true"
    android:layout_marginLeft="@dimen/margin_LEFT_RIGHT"
    android:layout_marginRight="@dimen/margin_LEFT_RIGHT"
android:layout_height="wrap_content">
<EditText
    android:layout_width="match_parent"
    android:layout_marginTop="10dp"
    android:layout_height="36sp"
    android:hint="Username"
    />

0
source

Source: https://habr.com/ru/post/1625271/


All Articles