Feature(iOS): Fonts are not scaled for a11y in nativescript.
See original GitHub issueTell us about the problem
Platform font-size setting not respected by nativescript apps.
This is a huge problem for our target audience, which include the some who are only partially sighted.
Which platform(s) does your issue occur on?
iOS only. It works as expected on Android.
Please provide the following version numbers that your issue occurs with:
- CLI: 4.1x
- Cross-platform modules: 4.1.x, 4.0.x, 3.x.
- Runtime(s): 4.1.0
- Plugin(s): none
Please tell us how to recreate the issue in as much detail as possible.
Create a nativescript app and run it on iOS.
- Go to
Settings -> General -> Accessibility -> Larger text
and change the font-size. - Go back to the
nativescript
app, the text is rendered the same size as before.
On iOS 10+
UILabel have the property adjustsFontForContentSizeCategory
https://developer.apple.com/documentation/uikit/uicontentsizecategoryadjusting/1771731-adjustsfontforcontentsizecategor?language=objc
But my experience from solving this with our @nota/nativescript-accessibility-ext
is that it only works for the preferred fonts on iOS
and those are not easily set from NativeScript
.
The way we solve it in @nota/nativescript-accessibility-ext
is by listening for the platform setting and scaling the font-size, unfortunately this is slow and gives makes the UI jumpy.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource. </bountysource-plugin>
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:6 (2 by maintainers)
@PatrickLohan You try use our (nota.dk)
@nota/nativescript-accessibility-ext
and the theme extensions, that’s what we do in our own app.We use Nativescript-Vue and create a custom boolean prop (default true) that can be used in any text elements (labels/buttons etc.) that need to not have a11y settings.