发生错误时(例如,当用户输入无效的名称(插入符号,例如:@ $等)时),我想使textBox的笔触颜色为红色,我该怎么做,这是我的文本框代码
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/etFullNameLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Full Name"
android:textColorHint="#b4ffff"
app:startIconTint="#b4ffff"
android:layout_margin="20dp"
app:startIconDrawable="@drawable/ic_person"
app:boxStrokeErrorColor="@color/color_on_secondary"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/etFullName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
</com.google.android.material.textfield.TextInputLayout>
答案 0 :(得分:0)