How to disable system font size scaling for maui app? android 33 version.
I tried to set configuration to default within MainActivity:
public override Android.Content.Res.Resources Resources
{
get
{
Android.Content.Res.Configuration configuration = new Android.Content.Res.Configuration();
configuration.SetToDefaults();
DisplayMetrics metrics = new DisplayMetrics();
if (Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.NMr1)
{
return CreateConfigurationContext(configuration).Resources;
}
else if (Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.Lollipop)
{
base.Resources.UpdateConfiguration(configuration, metrics);
return base.Resources;
}
else
{
return base.Resources;
}
}
}
in debug it resets display metrics density to default, but once in a while i see scaled font as system one. Also try tried to set:
configuration.FontScale = (float)1;
but the same.