【问题标题】:FMX ListBoxItem with ItemData.Bitmap issue on XE 10.1 BerlinXE 10.1 Berlin 上带有 ItemData.Bitmap 的 FMX ListBoxItem
【发布时间】: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


【解决方案1】:

问题已解决!

在 XE10 中需要在 Bitmap Load 后设置 StyleLookup !

【讨论】:

    猜你喜欢
    • 2016-12-13
    • 2019-01-14
    • 2017-01-16
    • 1970-01-01
    • 1970-01-01
    • 2017-07-26
    • 2016-12-11
    • 1970-01-01
    • 2023-03-17
    相关资源
    最近更新 更多