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.
flex - how to set the background color of a spark check box text label?
-
16-06-2023 - |
Question
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?
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow