[英]Change style of the right icon error TextInputLayout
I want to change the style of the right icon error (the image with ! sign) in a TextInputLayout
but I don't find how.我想更改TextInputLayout
正确图标错误(带有 ! 符号的图像)的样式,但我不知道如何更改。
It is possible?.有可能吗?
To do this in your Java class, you can do something like this:要在 Java 类中执行此操作,您可以执行以下操作:
// initialize your drawable object
Drawable myErrorDrawable = getResources().getDrawable(R.drawable.my_error_drawable);
// set the dimension/bounds
myErrorDrawable.setBounds(0, 0, myErrorDrawable.getIntrinsicWidth(), myErrorDrawable.getIntrinsicHeight());
// attach the drawable to your EditText.
editText.setError("An error occured", myErrorDrawable);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.