【发布时间】:2016-09-15 14:57:49
【问题描述】:
我有一个有趣的问题。我将 FMX 应用程序从 XE7 重新编译到 XE10.1 我有 ListBox 的表单,并且我在代码中动态创建了 TListBoxItem。
var
Item: TListBoxItem;
begin
Item := TListBoxItem.Create(nil);
Item.Parent := ListBox1;
Item.StyleLookup := 'listboxitemnodetail';
Item.Height:=50;
Item.WordWrap:=true;
Item.Text := 'abc';
Item.ItemData.Bitmap.LoadFromFile('img.bmp')
end;
但 ListBox 项中的图像不显示。此问题仅在 Delphi XE 10.1 Berlin 上。 在 Delphi XE7 上运行良好。
如果我在 IDE 代码中手动生成 ListBoxItem 可以正常工作
哪里有问题?
【问题讨论】:
-
This answer 对同一个问题,除非不清楚它是否涉及柏林 XE 10.1,建议使用
listboxitemleftdetail样式查找。 -
我测试过但结果是一样的 - 图片不显示
标签: delphi listbox firemonkey delphi-xe7 listboxitem