最近我刚开始使用Flex。我有一个问题。基本上,我有IconItemRender装饰的列表。但它并不完整。
如何让它充实。附上的是图像差异。左边的就是我所做的。正确的是我想做的事。
http://forums.adobe.com/servlet/JiveServlet/showImage/2-6336526-636052/Untitled.png
编辑:
<s:ArrayCollection id="acMainMenu">
<fx:Object mainMenuLabel="menu 1" icon="data/pics/menu_icon_1.png" decorator="data/pics/menu_side_1.png"/>
<fx:Object mainMenuLabel="menu 2" icon="data/pics/menu_icon_2.png" decorator="data/pics/menu_side_2.png"/>
<fx:Object mainMenuLabel="menu 3" icon="data/pics/import_icon.png" decorator="data/pics/menu_side_3.png"/>
<fx:Object mainMenuLabel="menu 4" icon="data/pics/export_icon.png" decorator="data/pics/menu_side_4.png"/>
<fx:Object mainMenuLabel="menu 5" icon="data/pics/menu_icon_5.png" decorator="data/pics/menu_side_5.png"/>
</s:ArrayCollection>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:Group>
<s:Rect x="0" y="-1" width="774" height="1005">
<s:fill>
<s:SolidColor color="#D31145" />
</s:fill>
</s:Rect>
<!--[#26ABE4, #F79820, #F65AAE, #C1D832, #FAFA44]-->
<s:List id="mylist" y="-1" width="222" height="668" alternatingItemColors="#FFFFFF"
change="mylist_changeHandler(event)" color="#424242" contentBackgroundColor="#F5F5F5"
dataProvider="{acMainMenu}" fontWeight="bold" horizontalCenter="-269" textAlign="start">
<s:itemRenderer>
<fx:Component>
<s:IconItemRenderer
labelField="mainMenuLabel"
iconField="icon"
decorator="{data.decorator}"/>
</fx:Component>
</s:itemRenderer>
</s:List>
</s:Group>