哪个主题属性更改 EditText 错误消息的文本颜色
在我的表单中,我在 EditText
字段上使用 setError("")
。我的应用程序主题扩展了 android:Theme.Holo
。
我已为 android:errorMessageBackground
和 android:errorMessageAboveBackground
手动设置了深色背景的图像。
现在的问题是:错误消息的文本颜色也很暗且不可读。
我尝试更改主题中的不同 textColor
属性,但无法找到正确的属性。
有人可以帮助我吗?
In my form, I use setError("")
on an EditText
field. My Application-Theme extends android:Theme.Holo
.
I have manually set an image with a dark background for android:errorMessageBackground
and android:errorMessageAboveBackground
.
And now here's the problem: The text color of the error message is also very dark and not readable.
I tried changing different textColor
attributes in my Theme, but I wasn't able to find the correct one.
Can anyone could help me, please?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
您可以使用HTML 字体标签更改文本颜色。
但是要自定义背景颜色,您应该创建自己的自定义弹出窗口。
欲了解更多信息,请访问此链接:-
如何将样式写入 EditText 中的错误文本安卓?
You can change the text color by using HTML Font Tag.
But for customizing background color, you should make your own custom pop up.
For more information, Kindly go through this link:-
How to write style to error text of EditText in android?
你可以试试这个:
You can try this one:
在manifest.xml中执行以下操作
do following in manifest.xml
假设你做了这样的事情:
你可以执行以下操作:
或者
或者如果你想要/需要阿尔法:
无论如何,你应该在你的 color.xml 中指定你的颜色(更好地维护):
然后像这样使用它
:乐趣 :)
Assuming you did sth like this:
you can do the following:
or
or if you want/need alpha:
Anyhow, you should specify your colors in your color.xml (wayyy better to be maintained):
and then use it like this:
Have fun :)
设置属性
android:textColorPrimaryInverse="YourCOLOR"
为所需的颜色。set the property
android:textColorPrimaryInverse="YourCOLOR"
to the color nedded.我的回复有效,是在 kotlin 中。
My response works, is in kotlin.