In my app, I have a TextInputLayout where the user enters its id, when the TextInputLayout does not have the focus looks like:
However, when the user touch the TextInputLayout (get the focus) the hint text looks like:
And I need hint text looks like as the follow image when the TextInputLayout have the focus:
Ignore the icon, its different but it does not matter in this moment, that I want to do is the hint text looks like the last image
Here is my code:
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/ilUser"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:orientation="vertical"
android:textColorHint="@color/et_login">
<EditText
android:id="@+id/etUser"
android:layout_width="match_parent"
android:layout_height="@dimen/et_login_height"
android:background="@drawable/edit_text_format"
android:drawableLeft="@drawable/user"
android:drawablePadding="10dp"
android:fontFamily="sans-serif"
android:hint="@string/user_id_text_hint"
android:inputType="number"
android:maxLength="12"
android:minLines="15"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:textCursorDrawable="@drawable/cursor_drawable_app"
android:textSize="@dimen/h5"
android:theme="@style/EditTextTheme" />
</com.google.android.material.textfield.TextInputLayout>
question from:
https://stackoverflow.com/questions/66066585/hint-text-is-overlapping-to-my-textinputlayout 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…