delphi firemonkey mobile 更改组合框的字体颜色
Change the font colour of combo box in delphi firemonkey mobile
我已经使用 Delphi XE7 firemonkey 为 Android 移动设备创建了应用程序。因为我正在使用 Combobox。如何更改组合框的字体颜色?
ComboBox1.ListBox.ListItems[0].TextSettings.FontColor := TAlphaColorRec.White;
ComboBox1.ListBox.ListItems[0].StyledSettings := ComboBox1.ListBox.ListItems[0].StyledSettings
- [TStyledSetting.ssFontColor];
在 firemonkey 应用程序中,上面的代码可以很好地更改组合框中第一项的字体颜色 "ComboBox1"。
我试过这段代码:
for i := 0 to Combobox1.Count -1 do
begin
ComboBox1.ListItems[i].Text := ' Hello';
ComboBox1.ListItems[i].Font.Style := [TFontStyle.fsBold];
ComboBox1.ListItems[i].Font.Size := 26;
ComboBox1.ListItems[i].StyledSettings := [];
ComboBox1.ListItems[i].Height := 30;
end;
但在我从 ComboBox 更改 属性 后它确实有效:
DropDownKind = 原生到自定义
我已经使用 Delphi XE7 firemonkey 为 Android 移动设备创建了应用程序。因为我正在使用 Combobox。如何更改组合框的字体颜色?
ComboBox1.ListBox.ListItems[0].TextSettings.FontColor := TAlphaColorRec.White;
ComboBox1.ListBox.ListItems[0].StyledSettings := ComboBox1.ListBox.ListItems[0].StyledSettings
- [TStyledSetting.ssFontColor];
在 firemonkey 应用程序中,上面的代码可以很好地更改组合框中第一项的字体颜色 "ComboBox1"。
我试过这段代码:
for i := 0 to Combobox1.Count -1 do
begin
ComboBox1.ListItems[i].Text := ' Hello';
ComboBox1.ListItems[i].Font.Style := [TFontStyle.fsBold];
ComboBox1.ListItems[i].Font.Size := 26;
ComboBox1.ListItems[i].StyledSettings := [];
ComboBox1.ListItems[i].Height := 30;
end;
但在我从 ComboBox 更改 属性 后它确实有效: DropDownKind = 原生到自定义