android - 如何以编程方式添加 ListBoxItem?

标签 android ios delphi firemonkey listboxitem

我只能找到如何通过单击组件 -> Items Editor 来创建 ListBoxItem

我们如何使用 Firemonkey 以编程方式创建 ListBoxItem

最佳答案

只需创建列表框项,并将其添加到列表框:

var
  ListBoxItem: TListBoxItem;
begin
  ListBoxItem := TListBoxItem.Create(ListBox1);
  ListBoxItem.Text := 'foo';
  // set other properties of the list box item at this point
  ListBox1.AddObject(ListBoxItem);
end;

关于android - 如何以编程方式添加 ListBoxItem?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33284499/

相关文章:

android - 适配器未在 listview android 中设置

ios - mapItemForCurrentLocation 找不到我的当前位置

ios - MakeAppIcon 中的应用程序图标未成功显示

Delphi TStringList 包装器实现即时压缩

android - 以编程方式设置线性布局之间的边距

android - 未找到样式 TextAppearance.Holo

android - 如何在当前应用中添加其他应用的链接

ios - 何时使用 Categories Objective-C?

delphi - INNO设置: How to implement file update based on different versions of the application

c# - delphi vs c# post 返回不同的字符串-utf 问题?