Description
Method; lets the list tell its cells the size at which they should lay themselves out. The cell
renderer should do layout so that it fits in the specified area, or the cell may bleed into other
parts of the list and appear broken.
If the cell renderer extends the UIObject class, you should implement the
instead. Write the same function that you would write for
properties instead of parameters.
height
Example
The following example sizes an image in the cell to fit within the bounds specified by the list:
function setSize(w:Number, h:Number):Void
{
image._width = w-2;
image._height = h-2;
image._x = image._y = 1;
}
This example is in a cell renderer class that extends UIComponent (which extends UIObject),
so you must implement
// By extending UIComponent, you get setSize for free;
// however, UIComponent expects you to implement size().
// Assume __width and __height are set for you now.
// You're going to expand the cell to fit the whole rowHeight.
function size():Void
{
// __width and __height are the underlying variables
// of the getters/setters .width and .height.
var c = multiLineLabel;
c._width = __width;
c._height = __height;
}
CellRenderer.setValue()
Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX 2004.
Usage
componentInstance.setValue(suggested, item, selected)
124
CellRenderer API
instead of
size()
setSize()
size()
, but use the
setSize()
, as follows:
method
and
width
Need help?
Do you have a question about the FLASH 8-COMPONENTS LANGUAGE and is the answer not in the manual?
Questions and answers