Android 当为空或任何验证时,如何更改TextInputLayout边框颜色
请注意,当出现错误或为空时,我想更改TextInputLayout的边框颜色作为图像。Android 当为空或任何验证时,如何更改TextInputLayout边框颜色,android,layout,android-edittext,android-textinputlayout,material-components-android,Android,Layout,Android Edittext,Android Textinputlayout,Material Components Android,请注意,当出现错误或为空时,我想更改TextInputLayout的边框颜色作为图像。 <com.google.android.material.textfield.TextInputLayout ... app:boxStrokeErrorColor="@color/yourBorderColor"> ... </com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
...
app:boxStrokeErrorColor="@color/yourBorderColor">
...
</com.google.android.material.textfield.TextInputLayout>
...
您可以阅读更多信息。您可以使用
boxStrokeErrorColor
属性:
<com.google.android.material.textfield.TextInputLayout
app:boxStrokeErrorColor="@color/..."
..>
谢谢你,伙计,但它无论如何都不会改变,只是我想在登录时设置error onClick button(点击按钮出错),伙计,但它无论如何都不会改变,只是我想在登录时设置error onClick button(点击按钮出错
textInputLayout.setBoxStrokeColorStateList(.....);