如何解决Delphi ListView DynamicAppearance如何在代码中指定一个Item文本的颜色?
如何在Delphi TlistView DynamicAppearance中更改TextColor
属性?
这是我添加项目和文本的代码
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;
我想通过代码为每个文本项指定TextColor
属性,因为在我的情况下(Android应用程序),使用概念模式的参数TextColor在更改智能手机的方向之前不起作用!难以置信...
有人可以通过使TextColor参数起作用或将其放入代码中的解决方案吗?
非常感谢有人可以帮助我
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。