Reputation: 859
I have noticed that when you change the ListView header background color there is a weird white text like shadow
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
select the source link property and move the default selected area to some other color
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.
Upvotes: 0
Views: 2966
Reputation: 31
Looking at ListView style internals, one may notice, that there is 'headetext' color object. Deducing, that some ListView code should load the color object to reflect the current styling, we may do the search in FMX pas files, and find the following styling code:
// Item Colors
FStyleResources.DefaultTextColor := GetColorFromStyle('foreground', claBlack); FStyleResources.DefaultTextSelectedColor := GetColorFromStyle('selectiontext', claBlack); FStyleResources.DetailTextColor := GetColorFromStyle('detailtext', claBlack); FStyleResources.HeaderTextColor := GetColorFromStyle('headertext', claWhite); FStyleResources.HeaderTextShadowColor := GetColorFromStyle('headertextshadow', claWhite);
So, there IS an option to control the text shadow color through styles, the style portion controlling it is just not there. Well, adding 'headertextshadow' TColorObject into each corresponding ListView style, and setting its color to Null, would solve your case without any code involved.
Upvotes: 0
Reputation: 859
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;
Upvotes: 4