Flex中List自己定义itemrenderer
<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"> <s:layout> <s:BasicLayout/> </s:layout> <fx:Declarations> <!-- 将非可视元素(例如服务、值对象)放在此处 --> </fx:Declarations> <fx:Script> <![CDATA[ import mx.collections.ArrayCollection; import mx.events.FlexEvent; [Bindable] private var dataArr:ArrayCollection = new ArrayCollection([ {id:0,label:"2"}, {id:1,label:"54"}, {id:2,label:"6fg"}, {id:3,label:"td"}, {id:4,label:"434"}, {id:5,label:"241"}, {id:6,label:"743"}]); ]]> </fx:Script> <s:List x="90" y="51" width="161" height="71" dataProvider="{dataArr}" itemRenderer="ListItemRenderer" > </s:List> </s:Application>