简体   繁体   English

颜色值无效-必须为#rgb,#argb,#rrggbb或#aarrggbb

[英]Color value not valid — must be #rgb, #argb, #rrggbb, or #aarrggbb

I am giving a colour code in textColour attribute in xml file. 我在xml文件的textColour属性中给出了颜色代码。

ie android:textColor="#fffffffff" 即android:textColor =“#fffffffff”

I am getting this error: Error: Color value not valid -- must be #rgb, #argb, #rrggbb, or #aarrggbb (at 'textColor' with value '#fffffffff'). 我收到此错误:错误:颜色值无效-必须为#rgb,#argb,#rrggbb或#aarrggbb(在'textColor'处,值为'#fffffffff')。

Still the colour is converting to black in layout. 颜色仍然在布局中转换为黑色。

Although I have got that the color code is not valid, it sholud be "#ffffffff"(White), but if it is not valid then why it is converting to black? 尽管我知道颜色代码无效,但应该是“ #ffffffff”(白色),但是如果无效,那么为什么要转换为黑色? What is happenig exactly? 到底是什么情况?

You have nine f characters there instead of eight, which is why it's complaining. 您在那里有9个f字符,而不是8个,这就是它抱怨的原因。 It's probably going to black because it fails validation and the default value is zero. 它可能会变黑,因为它无法通过验证并且默认值为零。

To Use transparent Color You Need To Replace #00000000 instead of #FFFFFFFFF 若要使用透明颜色,您需要替换#00000000而不是#FFFFFFFFF

To Fix Error :-) 解决错误:-)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM