- 创建现有item renderer的子类,比如spark.components.LabelItemRenderer,spark.components.IconItemRenderer,或者spark.components.supportClasses.ItemRenderer。使用spark.components.LabelItemRenderer可以获得最高的性能。在子类中可以控制背景显示和数据项的布局。如果想使用Flex的内建布局机制,且不是很在意性能,就创建spark.components.supportClasses.ItemRenderer的子类。
- 创建mx.core.UIComponent的子类。可以获得最好的性能,需要实现mx.core.IDataRenderer和spark.components.IItemRenderer接口。
Method | Description |
---|---|
commitProperties() | Commits any changes to component properties, either to make the changes occur at the same time or to ensure that properties are set in a specific order. For more information, see Implementing the commitProperties() method. |
createChildren() | Creates any child components of the component. For example, the ComboBox control contains a TextInput control and a Button control as child components. For more information, see Implementing the createChildren() method. |
measure() | Sets the default size and default minimum size of the component. For more information, see Implementing the measure() method. |
styleChanged() | Detects changes to style properties. For more information, see Overriding the styleChanged() method. |
updateDisplayList() | Sizes and positions the children of the component on the screen based on all previous property and style settings, and draws any skins or graphic elements used by the component. The parent container for the component determines the size of the component itself.
Note: You typically only have to implement this method when you use the mx.core.UIComponent class as the base class of your item renderer. You do not have to implement it when creating a subclass of the LabelItemRenderer class. Override
LabelItemRenderer.drawBackground() and
LabelItemRenderer.layoutContent() instead.
For more information, see Implementing the updateDisplayList() method. |
Method | Description |
---|---|
drawBackground() | Defines the background display of the item renderer. |
layoutContents() | Lays out the children of the item renderer. |
Invalidation method | Description |
---|---|
invalidateProperties() | Marks a component so that its commitProperties() method gets called during the next screen update. |
invalidateSize() | Marks a component so that its measure() method gets called during the next screen update. |
invalidateDisplayList() | Marks a component so that its updateDisplayList() methods get called during the next screen update. |