I have an item renderer that I want to change default colors of:
<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
initialize="init(event)"
creationComplete="created(event)"
dataChange="created(event)"
width="100%"
maxWidth="{FlexGlobals.topLevelApplication.width}"
contentBackgroundColor.hovered="0xff0018"
focusColor="0xff00ff"
contentBackgroundAlpha="0.8">
<s:states>
<s:State name="normal"/>
<s:State name="hovered"/>
<s:State name="selected"/>
</s:states>
The styles in the above code have no effect.
I also tried adding contentBackgroundColor to the List element but that only changed the background of the list and not the items.
css doesn't work either:
s|ItemRenderer{
backgroundColor:#2e2e2e;
}
How can I change background color of the item renderer?
I know I can skin it but that would be an overkill for a simple color change and I am positive that I had it working couple of years back without skinning.