Android TextInputLayout 删除编辑文本下方多余的 space

Android TextInputLayout remove extra space below edittext

我使用 TextInputLayout.FilledBox.Dense 作为我的 TextInputLayout 的样式,然后我通过添加 hintEnabled=false 禁用了提示,但随后它在 [=16= 的底部添加了额外的行]

代码片段

<android.support.design.widget.TextInputLayout
            android:id="@+id/name_text_input"
          style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox.Dense"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:hintAnimationEnabled="false"
            app:hintEnabled="false">

            <EditText
                android:id="@+id/login_tab_userid3"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:imeOptions="actionNext"
                android:inputType="textPersonName" />

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

截图

在你的 editText 中

输入这一行:android:background="@null"

您可以从此 android:background="@null" 中删除 EditText 下面的行,然后在 [=11= 下面创建 View ] 用于在 EditText

下方创建行
            <EditText
                android:layout_width="match_parent"
                android:background="@null"
                android:layout_height="wrap_content" />

            <View
                android:layout_width="match_parent"
                android:background="@android:color/white"
                android:layout_height="0.5dp"/>