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 and ListHeader. 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 and ListHeader. 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.

 

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 FooterAppearanceHeaderAppearanceItemAppearance 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:

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:

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 (CustomDynamicAppearanceListItemImageListItem, 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

  1. Implement a new TListView appearance package. The following samples contain different examples that customize the list view appearance to show:

  2. Install the customized appearance package in the IDE.
  3. 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

Samples

Categories:

http://docwiki.embarcadero.com/RADStudio/Berlin/en/Customizing_FireMonkey_ListView_Appearance

时间: 2024-10-18 10:24:14

firemonkey ListView DynamicAppearance的相关文章

Firemonkey ListView 点击事件

Firemonkey ListView 的点击事件一直让人摸不着头绪(各平台触发规则不太相同),因为它提供了点击相关的事件就有如下: OnChange:改变项目触发. OnClick:点击触发. OnItemClick:点击项目触发 Windows 平台:按下立即触发,放开后接着触发 OnItemClickEx. Android 平台:按下立即触发,不用放开接着 OnItemClickEx(按钮 Button 触发顺序与 Widnows 相同,要放开才会触发 OnItemClickEx). On

Firemonkey ListView 获取项目右方「>」(Accessory) 事件

适用:XE6 或更高版本 说明:ListView 在基本的项目里提供了 Accessory(项目右方「>」符号),但要如何分辨是否按下>或者项目本身呢?在 XE6 提供了 OnItemClickEx 事件可以辨识,如下例: procedure TForm1.ListView1ItemClickEx(const Sender: TObject; ItemIndex: Integer; const LocalClickPos: TPointF; const ItemObject: TListIte

XE7 & FMX 那些年我们一起上过的控件:ListView 之 (2) 加载数据时如何显示进度条

本文介绍一下ListView下如何加载数据.及使用进度条反馈当前进度给用户. 注意: 原创作品,请尊重作者劳动成果,转载请注明出处!!!原文永久固定地址:http://www.cnblogs.com/weii/p/4190694.html 我们先来看看效果图: 进度条需要这样用的,以下为本文参考代码: procedure TForm1.Button2Click(Sender: TObject); begin TThread.CreateAnonymousThread( procedure() v

XE7 & FMX 那些年我们一起上过的控件:ListView 之 (3) 加载数据时如何显示自定义样式

本文介绍一下ListView下如何加载数据.及使用进度条反馈当前进度给用户. 注意: 原创作品,请尊重作者劳动成果,转载请注明出处!!!原文永久固定地址:http://www.cnblogs.com/weii/p/4190719.html 我们先来看看效果图: FMX异常强大,我们可以发挥想像,自定义进度样式,以下为本文参考代码: procedure TForm1.Button3Click(Sender: TObject); var pe: TPie; //扇形作进度 rc: TRoundRec

如何改变 FMX ListView 颜色

需求:改变 ListView 颜色 适用:Firemonkey 任何平台 操作:Style 是改变控件外观最便捷的途径,ListView 也不例外,下面示范使用 StyleBook 来设定 ListView 的外观颜色,以 Android 平台为例: 导出 Android Style 皮肤档,由 Tools 菜单里的 Bitmap Style Designer 来导出,存成 Android.style(存好后为一般文字档): 开一个新工程: 加一个 ListView1 控件. 加一个 Style

Android 监听ListView、GridView滑动到底部

// 监听listview滚到最底部mIndexList.setOnScrollListener(new OnScrollListener() { @Override public void onScrollStateChanged(AbsListView view, int scrollState) { switch (scrollState) { // 当不滚动时 case OnScrollListener.SCROLL_STATE_IDLE: // 判断滚动到底部 if (view.get

C# 将Access中时间段条件查询的数据添加到ListView中

C# 将Access中时间段条件查询的数据添加到ListView中 一.让ListView控件显示表头的方法 在窗体中添加ListView 空间,其属性中设置:View属性设置为:Detail,Columns集合中添加表头中的文字. 二.利用代码给ListView添加Item. 首先,ListView的Item属性包括Items和SubItems.必须先实例化一个ListIteView对象.具体如下: ListViewItem listViewItem=new ListViewItem(); l

[ ObjectListView ] - ListView的增强控件 - 前言 (翻译)

********************************************************************************** 原  标 题: A Much Easier to Use ListView 原文地址: https://www.codeproject.com/Articles/16009/A-Much-Easier-to-Use-ListView 翻       译: 于国栋 http://www.shannon.net.cn *********

Android ListView工作原理完全解析(转自 郭霖老师博客)

原文地址:http://blog.csdn.net/guolin_blog/article/details/44996879 在Android所有常用的原生控件当中,用法最复杂的应该就是ListView了,它专门用于处理那种内容元素很多,手机屏幕无法展示出所有内容的情况.ListView可以使用列表的形式来展示内容,超出屏幕部分的内容只需要通过手指滑动就可以移动到屏幕内了. 另外ListView还有一个非常神奇的功能,我相信大家应该都体验过,即使在ListView中加载非常非常多的数据,比如达到