
Example 3-13. The itemRenderer attribute
<mx:TileList width="100%" height="100%"
dataProvider="{photoFeed}">
<mx:itemRenderer>
</mx:itemRenderer>
</mx:TileList>
4. Now
we’ll create a layout component for the item ren-
derer. Within the itemRenderer property, add a Compo
nent component using the code shown in Example 3-14.
Example 3-14. Adding the Component
<mx:TileList width="100%" height="100%"
dataProvider="{photoFeed}">
<mx:itemRenderer>
<mx:Component
</mx:Component>
</mx:itemRenderer>
</mx:TileList>
5. To create the layout the item renderer will use, within
the Component add the VBox component with a width at-
tribute with a value of 125 and a height attribute with a
value of 125. Add paddingBottom, paddingLeft, padding
Top, and paddingRight attributes each with a value of 5.
The code is shown in Example 3-15.
Example 3-15. Adding the VBox
<mx:TileList width="100%" height="100%"
dataProvider="{photoFeed}">
<mx:itemRenderer>
<mx:Component>
<mx:VBox width="125” height="125”
paddingBottom="5”
paddingLeft="5”
paddingTop="5”
paddingRight="5">
</mx:VBox>
</mx:Component>
</mx:itemRenderer>
</mx:TileList>
6. Within the VBox component, create an Image component.
Add a width attribute with a value of 75 and a height
30 | Chapter 3: Flex 101: Step by Step
Comentários a estes Manuais