Using ActionScript 3.0 Components |
|
|
|
| Customizing the UI Components > Customizing the List > Using styles with the List | |||
You can set style properties to change the appearance of a List component. The styles specify values for the component's skins and padding when the component is drawn.
The various skin styles allow you to specify different classes to use for the skin. For more information on using the skin styles, see About Skins.
The following procedure sets the value of the contentPadding style for the List component. Notice that the value of this setting is subtracted from the size of the List to achieve the padding around the content, so you might need to increase the size of the List to prevent text in the List from being cropped.
To set the contentPadding style for the List:
aList.setStyle("contentPadding", 5);
aList.setSize(145, 200);
aList.addItem({label:"1956 Chevy (Cherry Red)", data:35000});
aList.addItem({label:"1966 Mustang (Classic)", data:27000});
aList.addItem({label:"1976 Volvo (Xcllnt Cond)", data:17000});
aList.rowCount = aList.length;
|
|
|
|