From RAD Studio API Documentation
Jump to: navigation, search



TCommonObjectAppearance = class(TObjectAppearance, IMovablePersistent)


class PASCALIMPLEMENTATION TCommonObjectAppearance : public TObjectAppearance


Type Visibility Source Unit Parent
class public
FMX.ListView.Appearances FMX.ListView.Appearances


Base class that provides some functionality on top of TObjectAppearance that makes it easier to create new object appearance types.

This is a list of built-in object appearance classes that subclass TCommonObjectAppearance:

Using a TCommonObjectAppearance Subclass

An object appearance must have an owner, and a name that uniquely identifies the object appearance among the object appearances of its owner.

To change properties of an object appearance that affect its appearance, perform your changes between a call to BeginUpdate and a call to EndUpdate.

TCommonObjectAppearance provides the following properties to customize the object appearance:

The following table shows how properties of TCommonObjectAppearance match properties of TListItemDrawable:

TCommonObjectAppearance Property Corresponding TListItemDrawable Property
ActualPlaceOffset PlaceOffset
Align Align
Opacity Opacity
SizeWhenVisible Size
VertAlign VertAlign
Visible Visible

Subclasses may define additional properties that affect the appearance and match properties of TListItemDrawable subclasses.

You can handle the OnChange event to react when any of these properties changes, or OnHeightChange to react when Height changes.

You may restore the default values of properties that affect the appearance at any moment.

Subclassing TCommonObjectAppearance

To define a custom object appearance type, create a subclass of TCommonObjectAppearance and do the following:

On top of this, you should add as many additional properties as your object appearance requires.

Object appearance types are rarely implemented on their own. You usually implement a TListItemDrawable subclass first, and then you implement a matching object appearance type.

See Also