Hey there- I'm attempting to change the contentBackgroundColor of a List component depending on the content found within the dataprovider. For instance:
<s:ItemRenderer name="ir"
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
autoDrawBackground="true"
contentBackgroundColor="{(data.location == 'home')?0x000000:0x666666}">
Unfortunately this seems to be ignored as the list just shows the default white background. Can anyone suggest a solution?
I would override the set data setter method and set the style there since you are guaranteed to catch every change to the data: