Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error message text for TextInputLayout is cut off

Hey anyone know why this (see in the picture) happens? It's happens for Xiaomi MiA1, while on Nokia 7.1 works fine.

Cutted of error hint

My xml view layout

FrameLayout - root
 ScrollView
  RelativeLayout
   <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/til_email"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/profile.EMAIL"
                android:theme="@style/TextInputLayoutTheme"
                android:margin="16dp"
                android:paddingBottom="8dp"
                app:layout_constraintTop_toBottomOf="@+id/phone_wrapper"
                >

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/email"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:inputType="textEmailAddress"
                    android:textSize="16sp"
                    android:textColor="@color/darkTextColor"
                    android:imeOptions="actionDone"
                    tools:text="Email"
                    />
            </com.google.android.material.textfield.TextInputLayout>

I think that putting TextInputLayoutTheme is not relevant here, since I only manipulate with view's colors

like image 810
murt Avatar asked Nov 29 '18 16:11

murt


1 Answers

The error message text gets cut off if you are setting the error on a TextInputLayout more than once. So every time you are setting TextInputLayout error message text, just set it to null first.

textInputLayout.setError(null); textInputLayout.setErrorEnabled(false);
textInputLayout.setError("Error Message");

like image 53
Mayank jain Avatar answered Oct 05 '22 21:10

Mayank jain