消除隐藏字符串计数器的TextInputLayout溢出

时间:2019-06-11 18:29:36

标签: android android-textinputlayout

我有一个带有表单的应用程序。 但是当用户发送他时,如果发生错误,我会在TextInputLayout错误中显示错误,但这会隐藏我的字符串计数器。

有人知道我该如何解决TextInputLayout错误宽度?

示例:

!(https://image.noelshack.com/fichiers/2019/22/5/1559332379-sans-titre-convertimage.png

某些代码:

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:orientation="vertical"
    android:gravity="center_vertical"
    android:paddingBottom="16sp"
    android:paddingLeft="16sp"
    android:paddingRight="16sp"
    android:paddingTop="16sp"
    tools:context=".SignUpActivity">

    <android.support.design.widget.TextInputLayout
        android:id="T_log"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:counterEnabled="true"
        app:counterMaxLength="15">

        <EditText
            android:id="log1"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:hint="log"
            android:imeOptions="actionNext"
            android:inputType="text"
            android:singleLine="true"
            tools:ignore="Autofill" />

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

产生错误的代码:

     T_log.setError(errors.get("log"));

感谢帮助。

0 个答案:

没有答案