FMX.Mobile.ListViewMultiDetailAppearance Sample (Object Pascal)
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:
- Start | Programs | Appmethod | Samples and then navigate to Object Pascal\Samples\User Interface\ListView
- Subversion Repository: http://sourceforge.net/p/Appmethod/code/HEAD/tree/branches/Appmethod_113/Object%20Pascal/Samples/User%20Interface/ListView
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
- Navigate to the location given above and use Ctrl + click to select and open both SampleListViewMultiDetailAppearancePackage.dpk and SampleListViewMultiDetailAppearanceProject.dproj at once.
- On the Project Manager, right click your package entry and select Install.
- 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.
- FMX.Mobile.ListViewRatingsAppearance Sample (Object Pascal)
- FMX.Mobile.ListViewAddThumbAndCaption Sample (Object Pascal)
- FMX.Mobile.ListViewCustomBottomDetail Sample (Object Pascal)