Delphi FMX Grid列头样式设定
procedure TForm1.StringGrid1ApplyStyleLookup(Sender: TObject); var Header: THeader; HeaderItem: THeaderItem; I: Integer; begin Header := THeader((Sender as TStringGrid).FindStyleResource('header')); if Assigned(Header) then begin for I := 0 to Header.Count - 1 do begin HeaderItem := Header.Items[I]; HeaderItem.Font.Size := 100; HeaderItem.Font.Style := [TFontStyle.fsBold]; HeaderItem.TextSettings.HorzAlign := TTextAlign.Center; // new code line: HeaderItem.StyledSettings := HeaderItem.StyledSettings - [TStyledSetting.Size, TStyledSetting.Style]; end; Header.Height := 48; end; end;