tags:

views:

13

answers:

1

How to skin spark List component so that every adjacent itemRenderer has different color (something like mx DataGrid)?

+1  A: 

You can do this by creating a custom renderer derived from ItemRenderer and overriding the itemIndex setter. In your overridden method, set the background color based on whether the item index is odd or even. The Adobe docs have an example of this which you can find in this section:

http://help.adobe.com/en_US/flex/using/WS03d33b8076db57b9-23c04461124bbeca597-8000.html#WS03d33b8076db57b9-43c4a246124bc002543-8000

Hope that helps.

Wade Mueller
Great, thanks, it helps. There is also another way using alternatingItemColors="[0x00ff00, 0xff0000]"
dede
Good point, I forgot about that one. :)
Wade Mueller