FMX.Mobile.ListViewMultiDetailAppearance Sample (Object Pascal)

From Appmethod Code Examples
Jump to: navigation, search

This is a project that shows how to customize the appearance of a TListView to show three detail text items. It does this by using list view item appearances previously defined in a custom package.


You can find the ListViewMultiDetailAppearance Sample project at:


When you run the application, it shows a list view. Each list item shows tree different detail fields under their main label.

You can tap the ToggleEditMode button to have the list view enter a selection edit mode where you can select several items. The buttons at the bottom, LiveBindings and Fill in Code, let you fill the list view with items defined using LiveBindings or defined at run time, respectively.

How to Use the Sample

  1. Navigate to the location given above and use Ctrl + click to select and open both SampleListViewMultiDetailAppearancePackage.dpk and SampleListViewMultiDetailAppearanceProject.dproj at once.
  2. On the Project Manager, right click your package entry and select Install.
  3. Double click your project entry on the Project Manager and press F9 or choose Run > Run.


The package defines three subclasses of TPresetItemObjects that implement a custom appearance for list view items. It actually defines a base subclass that is later inherited and extended by the other two subclasses.

These subclasses use instances of TTextObjectAppearance to implement the three detail fields that each list item shows. The rest of the fields are inherited from TPresetItemObjects and customized as necessary.

The application uses these subclasses in the ItemAppearance.ItemAppearance and ItemAppearance.ItemEditAppearance properties of the list view to use the appearance defined in the installed package. You can tap ToggleEditMode to see how the application keeps the appearance in edit mode.

The LiveBindings button uses TLinkFillControlToField to fill the list view using LiveBindings. The Fill in Code button uses a for loop to fill the list view with items created at run time.


See Also