使用自定义ItemRenderer和Effects的TileList
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了使用自定义ItemRenderer和Effects的TileList相关的知识,希望对你有一定的参考价值。
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"> <mx:DefaultTileListEffect id="myTileListEffect" fadeOutDuration="500" fadeInDuration="500" moveDuration="1500" /> <mx:ArrayCollection id="arrColl"> <mx:source> <mx:Array> <mx:Object source="assets/Accordion.png" label="Accordion" /> <mx:Object source="assets/ApplicationControlBar.png" label="ApplicationControlBar" /> <mx:Object source="assets/Box.png" label="Box" /> <mx:Object source="assets/Button.png" label="Button" /> <mx:Object source="assets/ButtonBar.png" label="ButtonBar" /> <mx:Object source="assets/CheckBox.png" label="CheckBox" /> <mx:Object source="assets/ColorPicker.png" label="ColorPicker" /> <mx:Object source="assets/ComboBox.png" label="ComboBox" /> <mx:Object source="assets/DataGrid.png" label="DataGrid" /> <mx:Object source="assets/DateChooser.png" label="DateChooser" /> <mx:Object source="assets/DateField.png" label="DateField" /> <mx:Object source="assets/HorizontalList.png" label="HorizontalList" /> <mx:Object source="assets/HRule.png" label="HRule" /> </mx:Array> </mx:source> </mx:ArrayCollection> <mx:TileList id="tileList" dataChangeEffect="{myTileListEffect}" dataProvider="{arrColl}" itemRenderer="TileListItemRenderer" dragEnabled="true" dropEnabled="true" dragMoveEnabled="true" columnWidth="100" rowHeight="100" width="100%" height="100%" /> </mx:Application> <!-- below is the custom renderer used in the above example--> <?xml version="1.0" encoding="utf-8"?> <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" styleName="plain" verticalAlign="middle" horizontalAlign="center" horizontalScrollPolicy="off" verticalScrollPolicy="off" width="100%" height="100%"> <mx:Image source="{data.source}" /> <mx:Label text="{data.label}" truncateToFit="true" width="96" /> </mx:VBox>
以上是关于使用自定义ItemRenderer和Effects的TileList的主要内容,如果未能解决你的问题,请参考以下文章
Flex - 将参数发送到自定义 ItemRenderer?
如何编写自定义函数以从 `effects::Effect()` 中提取预测