Search code examples
delphilistviewfiremonkey

Delphi DX Seattle FMX TListView HeaderItem - Hide white Shadow text on non white background


I have noticed that when you change the ListView header background color there is a weird white text like shadow

enter image description here

does anyone know how to get rid of the white shadow?

Steps to reproduce

Create a FMX project, put a list view on it and align it to client
right click on the listview and choose edit custom style
In the lv1style1: TFmxObject find the header structure
enter image description here

select the source link property and move the default selected area to some other color enter image description here

populate the list view on form create - with the code like this

var lvitem : TListViewItem;
begin
  lvitem := lv1.Items.Add;
  lvitem.Text := 'Header';
  lvitem.Purpose := TListItemPurpose.Header;
  lvitem.Detail := '';


  lvitem := lv1.Items.Add;
  lvitem.Text := 'none';
  lvitem.Purpose := TListItemPurpose.None;

  lvitem := lv1.Items.Add;
  lvitem.Text := 'footer';
  lvitem.Purpose := TListItemPurpose.Footer;

if you have any questions please comment below
Any help would be appreciated.


Solution

  • There was a TextLabel.TextShadowColor setting
    On the List view OnUpdateObjects
    Added the following code

    procedure TForm1.lv1UpdateObjects(const Sender: TObject;
      const AItem: TListViewItem);
    var
      TextLabel: TListItemText;
    begin
      if AItem.Purpose in [TListItemPurpose.Header, TListItemPurpose.Footer] then begin
        TextLabel := AItem.Objects.TextObject;
        TextLabel.TextShadowColor := TalphaColorRec.Null;
      end;
    end;
    

    No Shadow