TMSFMXCalendar

Hi TMS,
On Android (both Phone and Tablet), the TMSFMXCalendar shows "eptember 2021" instead of "september 2021". You can clearly see that the starting "e" is also a little cut-off.
Works okay on iOS and Windows.
Not sure where in the source to change the available space for this text.
Any suggestions?
Thanks,
John

Hi,

You can do this with the following code:

uses
  FMX.ExtCtrls;

procedure TForm14.FormCreate(Sender: TObject);
var
  p: TPopupBox;
begin
  TMSFMXCalendar1.NeedStyleLookup;
  TMSFMXCalendar1.ApplyStyleLookup;
  p := TMSFMXCalendar1.FindStyleResource('months') as TPopupBox;
  p.StyledSettings := p.StyledSettings - [TStyledSetting.Size];
  p := TMSFMXCalendar1.FindStyleResource('years') as TPopupBox;
  p.StyledSettings := p.StyledSettings - [TStyledSetting.Size];
end;

By default the controls are having a styled setting on Android, this is typically a bigger font size than on Windows. By turning off the styled setting for the font size ,for these controls, you will have a consistent font size and have sufficient room for the text.

Pieter, dank!
in your suggestion accessing p threw an access violation, but you directed me to the right position in the sourcecode.

1 Like

Thanks for the feedback!