材质组件TextInputEditText底边距

时间:2018-08-08 21:35:56

标签: 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>

1 个答案:

答案 0 :(得分:0)

match_parent两个字段都将顺利进行