How could the font size be disabled is a Xamarin.iOS app/code? I had done this in Xamarin.Android app using the following code:
private void initFontScale()
{
Configuration configuration = Resources.Configuration;
configuration.FontScale = (float)1.45;
//0.85 small, 1 standard, 1.15 big,1.3 more bigger ,1.45 supper big
DisplayMetrics metrics = new DisplayMetrics();
WindowManager.DefaultDisplay.GetMetrics(metrics);
metrics.ScaledDensity = configuration.FontScale * metrics.Density;
BaseContext.Resources.UpdateConfiguration(configuration, metrics);
}
What would be the equivalent of doing this in an iOS Xamarin app? Any help would be greatly appreciated.
Use this in your App code behind before you initialise your pages:
Xamarin.Forms.Application.Current.On<iOS>().SetEnableAccessibilityScalingForNamedFontSizes(false);
You'll need to include these:
using Xamarin.Forms.PlatformConfiguration;
using Xamarin.Forms.PlatformConfiguration.iOSSpecific;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With