-1

所以我想做的是在选择项目时更改 iconitemrenderer 的样式。我试过检查我的物品的状态,但它似乎不起作用。

<s:IconItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"  creationComplete="onStart()" stateChangeComplete="stateChangedHandler()"
                xmlns:s="library://ns.adobe.com/flex/spark"  labelField="name"  decorator="/assets/highres/customerArrow.png" iconFunction="getIcon" iconWidth="60" iconHeight="60" iconField="icon" labelFunction="getName" >

stateChangedHandler() 中有一个永远不会触发的跟踪。我的最终目标是将标签从正常状态下的黑色更改为选定状态下的白色。有任何想法吗?

4

1 回答 1

0

尝试这样的事情(未经测试):

<s:IconItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"  creationComplete="onStart()" stateChangeComplete="stateChangedHandler()"
                xmlns:s="library://ns.adobe.com/flex/spark"  labelField="name"  decorator="/assets/highres/customerArrow.png" iconFunction="getIcon" iconWidth="60" iconHeight="60" iconField="icon" color.normal="0x000000" color.selected="0xffffff" labelFunction="getName">
    <s:states>
        <s:State name="normal" />
        <s:State name="selected" />
    </s:states>
</s:IconItemRenderer>
于 2014-11-11T07:52:47.660 回答