firemonkey ListView DynamicAppearance
Go Up to FireMonkey Application Design
Contents
[hide]
You can customize the appearance of a FireMonkey list view by modifying the layout of the list items, including the caption, the associated image, text details, or the accessory icon.
Customizing the List View Appearance Properties
At design time, you can change the footer, header, and the list items appearance (also for the editing mode) by modifying the values of the properties in the ItemAppearance property. The ItemAppearance property controls the footer, the header, and the item appearance size (normal and in editing mode).
The following appearance properties of a ListView are grouped in the Object Inspector and in the StructureView, and you can modify their values to customize your list view appearance.
Footer properties
- FooterHeight. This property designates the list footer height (in pixels). Default value:
24
. - FooterAppearance. This property designates the footer graphical appearance. Possible values are:
Custom
andListHeader
. Default value:ListHeader
.
Header properties
- HeaderHeight. This property designates the list header height (in pixels). Default value:
24
. - HeaderAppearance. This property designates the header graphical appearance. Possible values are:
Custom
andListHeader
. Default value:ListHeader
.
List item properties
- ItemHeight. This property designates the item height (in pixels). Default value:
44
. - ItemAppearance. This property designates the item graphical appearance (image, caption, accessory button, etc.). Default value:
ListItem
.
- Choose between the following values:
Property | Visible objects |
---|---|
Custom | See Using the Custom Value |
DynamicAppearance | See Using the DynamicAppearance Value |
ImageListItem | An image, a caption, and an accessory graphical button |
ImageListItemBottomDetail | An image, a caption, a detail text, and an accessory graphical button |
ImageListItemBottomDetailRightButton | An image, a caption, a detail text, and an accessory text button |
ImageListItemRightButton | An image, a caption, and an accessory text button |
ListItem | A caption and an accessory graphical button |
ListItemRightDetail | A caption, a detail text, and an accessory graphical button |
See FMX.ListViewCustomBottomDetail Sample and other Samples.
Edited list item properties
- ItemEditHeight. This property designates the item height (in pixels) when in edit mode. Default value:
44
. - ItemEditAppearance. This property designates the item graphical appearance when in edit mode. Default value:
ListItemShowCheck
.
- Choose between the following values:
Property | Visible objects |
---|---|
Custom | See Using the Custom Value |
DynamicAppearance | See Using the DynamicAppearance Value |
ImageListItemBottomDetailRightButtonShowCheck | An image, a caption, a detail text, a check box glyph button, and a text button |
ImageListItemBottomDetailShowCheck | An image, a caption, a detail text, a check box glyph button, and an accessory graphical button |
ImageListItemDelete | An image, a caption, a delete glyph button, and an accessory graphical button |
ImageListItemRightButtonDelete | An image, a caption, a delete glyph button, and a text button |
ImageListItemRightButtonShowCheck | An image, a caption, a check box glyph button, and a text button |
ImageListItemShowCheck | An image, a caption, a check box glyph button, and an accessory graphical button |
ListItemDelete | A caption, a delete glyph button, and an accessory graphical button |
ListItemRightDetailDelete | A caption, a detail text, a delete glyph button, and an accessory graphical button |
ListItemRightDetailShowCheck | A caption, a detail text, a check box glyph button, and an accessory graphical button |
ListItemShowCheck | A caption, a check box glyph button, and an accessory graphical button |
See FMX.ListViewCustomBottomDetail Sample and other Samples.
How to Modify List View Appearance Properties
Use the StructureView and the Object Inspector to find the List View component.
- In the Structure View, locate the ListView component and then click
ItemAppearance
in the hierarchy. - In the Object Inspector, modify each property (FooterAppearance, HeaderAppearance, ItemAppearance, ItemEditAppearance) to the desired value.
Customizable Item Appearances
The DynamicAppearance and Custom values allows you to customize the appearance of the items in a ListView. You can use the Customvalue for the FooterAppearance, HeaderAppearance, ItemAppearance and ItemEditAppearance properties of the items in the ListView, while you can use the DynamicAppearance for the ItemAppearance and ItemEditAppearance properties of the items in the ListView. You can also use built-in search filtering with the DynamicAppearance mode (*added in Subscription Update 1).
Using the DynamicAppearance Value
The DynamicAppearance allows you to dynamically customize the item appearance of the ListView at design time. The difference between DynamicAppearance and the other item appearance properties is that the DynamicAppearance allows you to add as many objects as you want to the appearance of your item.
By default, the DynamicAppearence contains a single text object. To add more objects, select Item
from IteamAppearance
in theStructureView. Then, in the Object Inspector, click the +
property and select any of the available objects. The available objects are:
- TTextObjectAppearance. Describes the graphical appearance of the text object of the list view item.
- TImageObjectAppearance. Describes the graphical appearance of the icon object of the list view item.
- TAccessoryObjectAppearance. Describes the graphical appearance of the accessory object of the list view item.
- TTextButtonObjectAppearance. Describes the graphical appearance of the text button object of the list view item.
- TGlyphButtonObjectAppearance. Describes the graphical appearance of a glyph button (graphical image) of the list view item.
You can customize the objects of the item appearance at design time by selecting an object in the StructureView and changing its properties in the Object Inspector. Among the things you can customize, these are some examples: the font type, text size or text alignment in text objects or the button type in button objects. Moreover, you can visually customize the objects of the item appearance enabling the Toggle DesignMode.
- Tip: As you can add as many objects as you want, it is highly recommended to use the DynamicAppearance with the Toggle DesignMode enabled.
Using the Custom Value
Selecting the Custom appearance value enables the following objects in the item appearance:
- Accessory. It is an instance of TAccessoryObjectAppearance. Not visible by default.
- Detail. It is an instance of TTextObjectAppearance. Not visible by default.
- GlyphButton. It is an instance of TGlyphButtonObjectAppearance. Not visible by default.
- Image. It is an instance of TImageObjectAppearance. Not visible by default.
- Text. It is an instance of TTextObjectAppearance. Visible by default.
- TextButton. It is an instance of TTextButtonObjectAppearance. Not visible by default.
- Note: You can customize the objects of the item appearance at design time by changing their properties using the Object Inspector or enabling the Toggle DesignMode.
To set the visibility of the desired objects:
- Enable the Visible property (by setting its value to
True
) in the Object Inspector for any of the desired objects and modify the properties according to your needs. - Enable the Visible property for any of the objects, by setting it to
True
in the source code.
Delphi:
AItem.Objects.AccessoryObject.Visible := True;
C++:
void __fastcall TForm1::SetEditItemProperties( TItemAppearanceObjects * AObjects)
{
AObjects->GlyphButton->Visible = true;
}
The Toggle Design Mode
The Toggle DesignMode allows you to visually customize the item appearance of a ListView at design time. You can select this mode for any ItemAppearance property (Custom
, DynamicAppearance
, ListItem
, ImageListItem
, etc.).
- Tip: The Toggle DesignMode is highly recommended when using the DynamicAppearance because the DynamicAppearance allows you to freely customize the ItemAppearance.
To select the Toggle DesignMode, right-click the TListView object in the StructureView or in the TForm and select it. The Toggle DesignMode changes the design-time view of the ListView object from a blank box to a design preview of the ListView item. Then, you can:
- Visually customize the item appearance in the form.
- Visualize the changes that you make to the item appearance properties using the Object Inspector.
Create a Customized Appearance Class
You can create and install a new customized appearance class and use it in your design, by installing a new package. This package defines the classes that implement a custom appearance for list view items. You can customize the fields as necessary, to implement a rating image for instance (a control that shows a different image based on a numeric value).
How to use the Customized Appearance Class
- Implement a new TListView appearance package. The following samples contain different examples that customize the list view appearance to show:
- Install the customized appearance package in the IDE.
- Once installed, the new appearance can be used with a TListView component in the Object Instpector.
- Note: The MultiDetailItem value is a customized appearance package, previously installed in the IDE.
See Also
- Mobile Tutorial: Using LiveBindings to Populate a ListView (iOS and Android)
- FireMonkey Native iOS Controls
- FMX.ListView.TAppearanceListView.ItemAppearance
- FMX.ListView.Appearances.TPublishedAppearance.FooterHeight
- FMX.ListView.Appearances.TPublishedAppearance.FooterAppearance
- FMX.ListView.Appearances.TPublishedAppearance.HeaderHeight
- FMX.ListView.Appearances.TPublishedAppearance.HeaderAppearance
- FMX.ListView.Appearances.TPublishedAppearance.ItemHeight
- FMX.ListView.Appearances.TPublishedAppearance.ItemAppearance
- FMX.ListView.Appearances.TPublishedAppearance.ItemEditHeight
- FMX.ListView.Appearances.TPublishedAppearance.ItemEditAppearance
Samples
http://docwiki.embarcadero.com/RADStudio/Berlin/en/Customizing_FireMonkey_ListView_Appearance
firemonkey ListView DynamicAppearance的更多相关文章
- delphi Firemonkey ListView 使用参考
delphi Firemonkey ListView 使用参考 Tokyo版本 http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Customizin ...
- Firemonkey ListView 点击事件
Firemonkey ListView 的点击事件一直让人摸不着头绪(各平台触发规则不太相同),因为它提供了点击相关的事件就有如下: OnChange:改变项目触发. OnClick:点击触发. On ...
- FireMonkey ListView 自动计算行高
说明:展示 ListView 视其每一行 Item 的 Detail 字串长度自动调整高度(可每行高度不同). 适用:Delphi XE7 / XE8 源码下载:[原创]ListView_自动计算行高 ...
- Firemonkey ListView 获取项目右方「>」(Accessory) 事件
适用:XE6 或更高版本 说明:ListView 在基本的项目里提供了 Accessory(项目右方「>」符号),但要如何分辨是否按下>或者项目本身呢?在 XE6 提供了 OnItemCl ...
- [示例] Firemonkey ListView 仿 iPhone X 浏海
Apple iPhone X 推出后,全屏上多了一个浏海,虽然褒贬不一,也有 Xcode 开发者做出了不错的 ListView 效果,当然 Delphi 也不落人後,马上试做看看. 源码下载:[示例] ...
- 【转】FireMonkey ListView 自动计算行高
说明:展示 ListView 视其每一行 Item 的 Detail 字串长度自动调整高度(可每行高度不同). 适用:Delphi XE7 / XE8 源码下载:[原创]ListView_自动计算行高 ...
- 如何改变 FMX ListView 颜色
需求:改变 ListView 颜色 适用:Firemonkey 任何平台 操作:Style 是改变控件外观最便捷的途径,ListView 也不例外,下面示范使用 StyleBook 来设定 ListV ...
- XE7 & FMX 那些年我们一起上过的控件:ListView 之 (3) 加载数据时如何显示自定义样式
本文介绍一下ListView下如何加载数据.及使用进度条反馈当前进度给用户. 注意: 原创作品,请尊重作者劳动成果,转载请注明出处!!!原文永久固定地址:http://www.cnblogs.com/ ...
- 张高兴的 UWP 开发笔记:横向 ListView
ListView 默认的排列方向是纵向 ( Orientation="Vertical" ) ,但如果我们需要横向显示的 ListView 怎么办? Blend for Visua ...
随机推荐
- hihoCoder 1288 Font Size 二分
题意:给定一个宽度为和高度为的屏幕,如果字体的大小为,那么一行可以显示个字,每一页可以显示行.给出段文本段落,每段有个文字,问现在能设置的最大字体并且总的页数不能超过? 思路:如果知道字体大小很容易求 ...
- Acm弱校奋斗史
我也是来自弱校的,没有教练,甚至老师都不理我们这种Acmer.看完这篇文章感触颇深. 原文链接 http://acmicpc.info/archives/369 原文 题解:还记得2年前的一个晚上,我 ...
- SpringMvc Json LocalDateTime 互转,form urlencoded @ModelAttribute 转换
JDK8 的LocalDate 系列日期API ,比Date 或者 Calendar 都好用很多,但是在SpringMvc 自动装配会有点小问题 会导致抛出类似异常 default message [ ...
- ubuntu设置网络
二 .设置无线网络 1.首先确认一下你的无线驱动已经安装 方法一,查看一下ubuntu右上角的网络设置中有无线连接,如果有说明已经驱动了,ubuntu自带的就会驱动无线网卡. 方法二,iwconfig ...
- 用Node.JS+MongoDB搭建个人博客(万众期待的router.js)(四)
万众期待的router.js,是我现在最想写的一个博客.因为他包含了整个个人博客的精髓.在这里,所有的请求配置,返回的参数等等所做的业务逻辑都在这个文件里实现. 我会详细说明这些代码的作用,所以这篇博 ...
- javascript对象(简略)
javascript对象有着自有的属性,对象可以从一个称为原型的对象继承属性,对象的方法通常是继承的属性,原型式继承是javascript的核心特征.
- VS2005 添加lib 的方法
应用程序使用外部库时需要进行加载,两种库的加载本质上都是一样:提供功能和功能的定义.vs2005 c++ 项目设置外部库方法如下:1. 添加编译所需要(依赖)的 lib 文件 在"项 ...
- UBOOT添加命令的执行流程
BootLoader(引导装载程序)是嵌入式系统软件开发的第一个环节,它把操作系统和硬件平台衔接在一起,对于嵌入式系统的后续软件开发十分重要,在整个开发中也占有相当大的比例.U-BOOT是当前比较流行 ...
- Linux显示机器的处理器架构
Linux显示机器的处理器架构 youhaidong@youhaidong-ThinkPad-Edge-E545:~$ arch x86_64 youhaidong@youhaidong-ThinkP ...
- Initialization error SQL*Net not properly installed
1.错误描述 2.错误原因 由于我在64位操作系统上安装了32位PL/SQL导致出错,出现兼容性连接问题 3.解决办法 安装一个32位的Oracle客户端,Tools-Preferences-Orac ...