dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.15k stars 1.74k forks source link

Font auto scaling doesn’t work on iOS. #16625

Open PaulNiemiec opened 1 year ago

PaulNiemiec commented 1 year ago

Description

On iOS on fresh app font auto scaling does not work.

Steps to Reproduce

  1. Create new Maui app.
  2. Open the app on iOS device.
  3. Go to accessibility settings and change font size.
  4. Go back to the app. Font size should change, but it does not.

Link to public reproduction project repository

No response

Version with bug

7.0.49

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

No response

Did you find any workaround?

I found workaround, but it does not work properly in every case:

        Microsoft.Maui.Handlers.LabelHandler.Mapper.AppendToMapping(nameof(Label), (handler, view) =>
        {
            handler.PlatformView.AdjustsFontForContentSizeCategory = true;
        });

Relevant log output

No response

PureWeen commented 1 year ago

@PaulNiemiec this is a known issue where the running app won't auto update the font sizes. If you restart the app you should see font size changes.

ghost commented 1 year ago

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

XamlTest commented 1 year ago

Verified this on Visual Studio Enterprise 17.8.0 Preview 1.0. Repro on iOS 16.4 .NET 8, not repro on Windows 11 and Android 13.0-API33 with below Project: 16625.zip

ChristopherStephan commented 2 weeks ago

Does this issue refer to the option "Larger Accessibility Sizes" (A)? This option seems to take no effect at the moment. What works for me is that the font sizes are adapted in the app when just changing the slider at the bottom of the settings (B).

Simulator Screenshot - iPhone 15 2nd - 2024-10-08 at 13 52 04