Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

TListViewEx + FontSize #54

Open
kazuser opened this issue Dec 19, 2022 · 1 comment
Open

TListViewEx + FontSize #54

kazuser opened this issue Dec 19, 2022 · 1 comment

Comments

@kazuser
Copy link

kazuser commented Dec 19, 2022

Could you please tell me how to fix it? FontsSize is too small ("1" or "2") by default 😕

image

@KngStr
Copy link
Collaborator

KngStr commented Apr 17, 2023

By default it will use the default font.
If you just type this code in the picture, it's weird. We need a sample.

Another way you can chagne the font like this

type
  TMyStringsListCheckAdapter = class(TStringsListCheckAdapter)
  protected
    function GetView(const Index: Integer; ConvertView: TViewBase; Parent: TViewGroup): TViewBase; override;
  end;

{ TMyStringsListCheckAdapter }

function TMyStringsListCheckAdapter.GetView(const Index: Integer;
  ConvertView: TViewBase; Parent: TViewGroup): TViewBase;
var
  ViewItem: TListViewItemCheck;
begin
  Result := inherited;

  // just when first create
  if (ConvertView = nil) or (not (ConvertView is TListTextItem)) then begin
    ViewItem := TListViewItemCheck(Result);
    ViewItem.TextView1.TextSettings.Font.Size := 24;
  end;
end;

procedure TFrameListViewTest.DoShow;
var
  I: Integer;
  Adapter: TMyStringsListCheckAdapter;
begin
  inherited;

  Adapter := TMyStringsListCheckAdapter.Create(nil);
  Adapter.SetArrayLength(1000);
  for I := 0 to Adapter.Count - 1 do
    Adapter.Items[I] := Format('test list item %d', [I]);
  ListViewEx1.Adapter := Adapter;
end;

Test unit from FMXUI\demos\standard\uFrameListViewTest.pas:

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants