문제

I have a simple spark mxml check box and I want to change the background color via actionscript. I have searched and tried many suggestions, including using setStyle with 'background-color', 'chromeColor', symbolColor and others like this - the only thing that worked at all is chromeColor, which colored the box but not the text or background:

insUpdatedCB.setStyle('chromeColor','yellow');

I also tried using text format like this:

var myTf:TextFormat = new TextFormat();
myTf.size = 16; 
myTf.color = 0xFF0000; 
insUpdatedCB.setStyle("textFormat", myTf);  

also did not work

how can I set the label/text background color?

도움이 되었습니까?

해결책

If you want to change the background color of the spark checkbox, then you have to apply a custom skin for it. Make a new Custom skin by making a copy of default checkboxSkin for spark checkbox, and then change the background color of the label in the Custom Skin.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top