0
在我的程序中,我制作了一个读取xml博客的功能,并将标题放在TListBox
中。但我需要更改TListBoxItem
中的一些属性,如字体,高度和颜色,但不会更改。如何在运行时更改android应用程序中的TlistBoxItem属性?
如何在运行时设置它?
repeat
Title := ANode.ChildNodes['title'].Text;
Link := ANode.ChildNodes['link'].Text;
Desc := ANode.ChildNodes['description'].Text;
DataPub := ANode.ChildNodes['pubDate'].Text;
SetLength(Vet_News, Pos + 1);
Vet_Nesw[Pos] := '<h2>'+Title+'</h2>'+Desc;
Itemx := TListBoxItem.Create(self);
Itemx.Text := Title;
Itemx.ItemData.Detail := DataPub;
Itemx.ItemData.accessory := TListBoxItemData.TAccessory.aMore;
Itemx.TextSettings.WordWrap := true;
Itemx.TextSettings.FontColor := TAlphaColorRec.Darkorange;
Itemx.Height := 65;
Itemx.FontColor := TAlphaColorRec.Darkorange; // i tried two ways to change the color
lbNews.AddObject(Itemx); // lbnews is a Tlistbox
Inc(Pos);
ANode := ANode.NextSibling;
until ANode = nil;
您可能需要更改TListBox或列表框项目的样式。 – 2014-11-22 12:46:27
另一个想法?只有在运行时我无法更改设置。 – Murilo 2014-12-02 18:11:37
Via StyleLookup(该项目)?更改项目使用的样式,或更改查找以引用新样式。否则,你能扩展你的问题吗? – 2014-12-02 21:22:43