首页 > 解决方案 > 带有 TextInputEditText 的 TextInputLayout:EMS 自更新后损坏

问题描述

在将我的库更新到最新版本后,我注意到使用 ems 的代码TextInputEditText不再起作用。我找不到背后的原因。

在更新之前有效的代码现在看起来不像这样(我的意思是 TextView 不再像 EMS 建议的那样宽,但默认为最小宽度)

<com.google.android.material.textfield.TextInputLayout
                android:id="@+id/til"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="10dp"
                android:layout_marginTop="10dp"
                android:layout_marginEnd="10dp"
                android:hint="Some hint"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="parent">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/tiet"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:autofillHints="Some Hint"
                    android:imeOptions="actionNext"
                    android:importantForAutofill="yes"
                    android:inputType="text"
                    android:ems="7" />
</com.google.android.material.textfield.TextInputLayout>

标签: androidandroid-textinputedittext

解决方案


推荐阅读