Custom draw a List component in Flex with AS3
I need a List开发者_开发技巧 component that will display custom data. I want to extend a spark List or any List component and add my code to paint each item. I done this in other frameworks but for Flex i found only simple examples that change the font and background color, i need access to a Graphics object to paint my items as i need,is there a method that i can override or some example /class i should look at?
All UIComponents has a 'graphics' property that you can draw to, however, I'm not too sure why you'd want to extend the list component just to paint each item. Each item renderer is responsible for painting itself. If anything, just use the normal List and specify the itemRenderer property to point to a custom item renderer of your own (that extends ItemRenderer) that can take in data and paint things accordingly.
精彩评论