This is what I’ve done so far.
<!-- fill -->
<!--- Defines the appearance of drop-down list's background fill. -->
<s:Rect id="background" left="1" right="1" top="1" bottom="1" >
<s:fill>
<!---
The color of the drop down's background fill.
The default color is 0xFFFFFF.
-->
<s:SolidColor id="bgFill" color="#DB9E36"/>
</s:fill>
</s:Rect>
If you look closely you’ll see that I’ve changed the default value for the bgFill color. However, when I run my application, the background color for the dropdownlist is still the default white.
Am I doing anything wrong here?
Thanks in advance.
Easy way to do this is by using the contentBackgroundColor style. Something like this:
Some more details..
When creating a custom skin; there is a list of properties called contentFill; defined like this:
You’ll notice the value listed here is the bgFill; the same background whose color you are trying to change.. And it can be retrieved publicly by using the contentItem property:
The SparkSkin class [which all MXML Skins extend by default] access this value inside of updateDisplayList. Every property in the contentItems array has it’s background color specificed using the contentBackgroundColor and it’s alpha specified using contentBackgroundAlpha.
It is a bit misleading that a value is explicitly defined in the MXML then [potentially] overwritten in ActionScript.