Does anyone know how to implement Support For Dynamic Type in React Native?
Ideally, we would like to listen for when someone has changed the size of the system font, and perform some type of callback.
Or even better, prevent Font Scaling from being implemented at all on some components.
Dynamic Type is a feature that was introduced in iOS 7 allowing users to change the default font size used across iOS. It is intended predominantly to support visually impaired users but in practice there are many iOS users who simply prefer a smaller / larger reading size for a variety of reasons.
Fortunately, Safari's UIWebView (what Safari uses to display Web pages) handles this communication for you, but you have to do some work up front in your Web page. iOS has a feature called Dynamic Type (introduced in iOS 7) which communicates to applications what the user's preferred text size is.
React Native supports building apps for iOS, Android, and web from a single code base. It's a more affordable technology than Swift, yet it allows creating high-quality apps.
We are excited to share that the latest Facebook Messenger iOS app now supports Dynamic Type which means if you adjust the font size in the Settings panel, it will reflect within the app with the appropriate font size!
Well, turns out you can apply:
allowFontScaling={false}
To prevent this.
This worked for me:
<Text allowFontScaling={false}>Do not want font to scale</Text>
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