Delphi ListView DynamicAppearance how to specify the color of the text of one Item in code?

  

How can I change the TextColor property in a Delphi TlistView DynamicAppearance?
Here is my code to add an Item and text
function TForm1.Remplissage_ListViewNews(debut_news, fin_news:Integer) :Integer;
var
_Image,_Title,_Location, _Infos,_Details,_Url:TField;
_Item: TListViewItem;

begin

MySQLQuery_News.SQL.Text := ‘SELECT * FROM news’ + ‘ LIMIT ‘+IntToStr(debut_news)+’,’+IntToStr(fin_news);
MySQLQuery_News.Active := True;
MySQLQuery_News.Open;

if MySQLQuery_News.RecordCount > 0 then
begin
MySQLQuery_News.First;
MySQLQuery_News.DisableControls;

_Image := MySQLQuery_News.FieldByName(‘id_news’);
_Title := MySQLQuery_News.FieldByName(‘nom_expo’);
_Location := MySQLQuery_News.FieldByName(‘location’);
_Infos := MySQLQuery_News.FieldByName(‘infos’);
_Details := MySQLQuery_News.FieldByName(‘commentaire_fr’);
_Url := MySQLQuery_News.FieldByName(‘url_fr’);

try

ListView_News.BeginUpdate;
ListView_News.EditMode := True;
ListView_News.Visible := false;

while (not MySQLQuery_News.EOF) do begin
_Item := ListView_News.Items.Add;
_Item.Data[‘Title’] := _Title.AsString;
_Item.Data[‘Infos’] := _Location.AsString + ‘ – ‘ + _Infos.AsString;
_Item.Data[‘Details’] := copy(_Details.AsString,1,350);
_Item.Data[‘Url’] := _Url.AsString;
_Item.Data[‘Image’] := RecupereImage(Image_url + ‘news/’+ _Image.AsString + ‘.jpg’);
MySQLQuery_News.Next;
end;

finally

MySQLQuery_News.EnableControls;
ListView_News.Visible := True;
ListView_News.EditMode := False;
ListView_News.EndUpdate;

end;

Result := ListView_News.ITems.Count;

end
else
begin
showmessage(‘Aucun enregistrement trouvé’);
Result := 0;
end;

end;

I would like to specify by code the TextColor property for each text Item because in my case ( Android application ) the parameter TextColor using the Conception mode do not work until I change the orientation of my smartphone! Incredible …
Does someone have a solution to make the TextColor parameter work or to put it in the code ?
Thanks a lot if someone could help me

Comments are closed.