0

最近我刚刚开始使用 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>

4

0 回答 0