gpt4 book ai didi

android - TextInputLayout 的错误消息文本被截断

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:15:17 25 4
gpt4 key购买 nike

嘿,有人知道为什么会这样(见图片)吗?它发生在小米 MiA1 上,而在诺基亚 7.1 上工作正常。

Cutted of error hint

我的 xml View 布局

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>

我认为放置 TextInputLayoutTheme 在这里不相关,因为我只操作 View 的颜色

最佳答案

如果您多次在 TextInputLayout 上设置错误,错误消息文本将被截断。因此,每次设置 TextInputLayout 错误消息文本时,只需先将其设置为 null。

textInputLayout.setError(null);
textInputLayout.setErrorEnabled(false);<br/>
textInputLayout.setError("Error Message");

关于android - TextInputLayout 的错误消息文本被截断,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53543063/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com