FMX.Mobile.ListViewCustomBottomDetail Sample (Object Pascal)
This is a project that shows how to customize the appearance of a TListView to show a detail text at the bottom of every list view item. It does this by using the "Custom" list view item appearance value and configuring the appearance properties of list view items at design time. It also shows how to do this at run time.
You can find the ListViewCustomBottomDetail Sample sample project at:
- Start | Programs | Appmethod 1.16 | Samples and navigate to:
Object Pascal\Multi-Device Samples\User Interface\ListView\ListViewCustomBottomDetail
CPP\Multi-Device Samples\User Interface\ListView\ListViewCustomBottomDetail
- Subversion Repository:
When you run the application, it shows a list view. Each list item shows a detail text under its main label.
Tap the Set Properties button to change the appearance of the list view at run time. 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 one of the locations given above, and open:
- Object Pascal: SampleListViewCustomBottomDetailProject.dproj
- C++: SampleListViewCustomBottomDetailProject.cbproj
- Press F9 or choose Run > Run.
The values of the ItemAppearance.ItemAppearance and ItemAppearance.ItemEditAppearance properties of the list view in this application are "Custom". This indicates that, instead of using a default appearance set, the appearance objects of the item appearance are customized. They have been customized at design time, selecting appearance objects in the Structure view and changing their properties from the Object Inspector.
By default, the base custom appearance only has one visible appearance object: Text. That is, Text is the only visible appearance object in TListView.ItemAppearance.Item and TListView.ItemAppearance.ItemEdit. This application makes visible the following appearance objects as well, and configures their properties to customize their appearance:
In addition to these design time changes, this application handles the OnUpdateObjects event of the list view to adjust the width of the Text and Detail appearance objects.
The Set Properties button, when tapped, modifies the appearance of the list view at run time, performing appearance adjustment on top of the custom appearance defined at design time.
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.ListViewAddThumbAndCaption Sample (Object Pascal)
- FMX.Mobile.ListViewMultiDetailAppearance Sample (Object Pascal)
- FMX.Mobile.ListViewRatingsAppearance Sample (Object Pascal)