android - Material 组件 TextInputEditText 底线边距

标签 android components android-textinputlayout android-textinputedittext material-components-android

我有一个问题。 TextInputLayout 相对于该行有边距或填充。

我需要这条线是全宽。

文档: https://material.io/develop/android/components/text-input-layout/

Screenshot of <code>TextInputLayout</code>

代码:

<com.google.android.material.textfield.TextInputLayout
    android:id="@+id/inputLayoutEmail"
    style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginTop="10dp"
    android:paddingBottom="0dp"
    app:boxBackgroundColor="@color/colorBgDisableButton"
    app:boxCornerRadiusTopEnd="10dp"
    app:boxCornerRadiusTopStart="10dp"
    android:hint="@string/text_signup_email"
    android:textColorHint="@color/colorTextInput"
    android:focusable="false"
    android:clickable="false"
    app:errorEnabled="true"
    app:errorTextAppearance="@style/ErrorTextAppearance"

    >

    <com.google.android.material.textfield.TextInputEditText
        android:id="@+id/inputTextEmail"
        android:layout_width="300dp"
        android:layout_height="wrap_content"
        android:backgroundTint="@color/colorLineInput"
        android:fontFamily="@font/century_gothic"
        android:imeOptions="actionNext"
        android:inputType="textEmailAddress"
        android:lines="1"
        android:maxLines="1"
        android:paddingStart="22dp"
        android:paddingBottom="20dp"
        android:textColor="@color/colorTextInput"
        android:textSize="14sp"
        android:enabled="false"
        android:focusable="false"
        android:clickable="false"
        android:layout_marginStart="0dp"
        android:layout_marginEnd="0dp"

        />

</com.google.android.material.textfield.TextInputLayout>

最佳答案

match_parent 两个字段都会顺利进行

关于android - Material 组件 TextInputEditText 底线边距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51755972/

相关文章:

java - 为什么 textview 中的换行符会导致换行符缩进?

android - 创建双行项目布局后无用的属性

components - OSGi 组件中@Component 的 'enable=true' 属性是什么?

android - 如何更改未聚焦的 textInputLayout 的轮廓或边框的颜色?

android - 没有消息的 TextInputLayout 设置错误?

android - 这个方法做了什么 super.onCreateOptionMenu() 和 super.onOptionsItemSelected(item)

java - 使用 Android 从 URL 获取 JSON 数据响应?

javascript - 从另一个组件 react 更新组件

delphi - 你能帮忙把这个非常小的 C++ 组件翻译成 Delphi 吗?

android - 未聚焦时如何更改textinput edittext下划线颜色?