1
I need my Listview to identify the values of a Text item, for example: , "Complete"/"Pending" and make each one a different color within Listview. I tried to format by code, but I could not, I saw that in . VCL has the Customdrawsubitem that puts the loop there and does it, but I did not find in . FMX which is what I want. The one below gives Acess Violation, how should I do this?
procedure TformExames.listView1ApplyStyleLookup(Sender: TObject);
var
i : integer;
begin
for i := 0 to listView1.Items.Count -1 do
if listView1.Items[i].Text = 'Cancel' then
listView1.BeginUpdate;
listView1.Items[i].Objects.TextObject.TextColor := 444444;
listView1.EndUpdate;
end;
I did what you said, it gives the following error: [dcc32 Error] frmExames.pas(70): E2010 Incompatible types: 'Tlistitemtext' and 'Tlistitemdrawable'
– Filipe
Inside the for, replace "txt := ..." with: txt := Tlistitemtext(listView1.Items[i].Objects.Finddrawable('Meubtn'));
– Heber
Now yes, that’s what I wanted. Thank you!
– Filipe