-
-
Notifications
You must be signed in to change notification settings - Fork 241
Closed
Description
Hi,
I am trying to implement accessibility support in my apps to respect the system text settings.
This is just some off-topic information: I use this code to get the multiplier:
function GetFontScale: Single;
{$IF DEFINED(ANDROID)}
function GetFontSizeMultiplier: Single;
var
Configuration: JConfiguration;
begin
Configuration := TAndroidHelper.Context.getResources.getConfiguration;
Result := Configuration.fontScale;
end;
{$ELSEIF DEFINED(IOS)}
function GetFontSizeMultiplier: Single;
var
App: UIApplication;
Category: NSString;
begin
App := TUIApplication.Wrap(TUIApplication.OCClass.sharedApplication);
Category := App.preferredContentSizeCategory;
if Category.isEqualToString(UIContentSizeCategoryExtraSmall) then
Exit(0.8);
if Category.isEqualToString(UIContentSizeCategorySmall) then
Exit(0.9);
if Category.isEqualToString(UIContentSizeCategoryMedium) then
Exit(0.95);
if Category.isEqualToString(UIContentSizeCategoryLarge) then
Exit(1.0);
if Category.isEqualToString(UIContentSizeCategoryExtraLarge) then
Exit(1.1);
if Category.isEqualToString(UIContentSizeCategoryExtraExtraLarge) then
Exit(1.2);
if Category.isEqualToString(UIContentSizeCategoryExtraExtraExtraLarge) then
Exit(1.3);
if (Category.rangeOfString(StrToNSStr('Accessibility')).location <> NSNotFound) then
Exit(1.5);
Result := 1.0;
end;
{$ELSE}
function GetFontSizeMultiplier: Single;
begin
Result := 1.0;
end;
{$ENDIF}
begin
Result := GetFontSizeMultiplier;
end;When I change the size of the text settings inside a button or other components, they disappear.
Here is a sample to reproduce the problem.
Metadata
Metadata
Assignees
Labels
No labels