如何在TextInputLayout的焦点上更改边框和颜色?

问题描述 投票:0回答:1

如何更改TextInputLayout的焦点和颜色?

<com.google.android.material.textfield.TextInputLayout
        android:layout_width="match_parent"
        style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
        android:layout_height="wrap_content"
        app:boxStrokeWidth="4dp"
        app:boxStrokeColor="@color/colorPrimary"
        app:layout_constraintTop_toBottomOf="@id/a">

        <com.google.android.material.textfield.TextInputEditText
            android:layout_width="match_parent"
            android:hint="@string/app_name"
            android:textColorHint="@color/colorPrimary"
            android:layout_height="wrap_content"/>
    </com.google.android.material.textfield.TextInputLayout>

我尝试:

app:boxStrokeWidth="4dp"
app:boxStrokeColor="@color/colorPrimary"

但是,不能集中精力工作>

如何在TextInputLayout中更改边框和颜色的焦点?

android android-xml android-textinputlayout material-components-android
1个回答
0
投票

更改边界;将可绘制选择器用于TextInputLayout

的背景
© www.soinside.com 2019 - 2024. All rights reserved.