Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Supporting Dynamic Type in React Native (iOS)

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.

enter image description here

like image 593
Nader Dabit Avatar asked Jan 27 '16 19:01

Nader Dabit


People also ask

How would you explain dynamic type to a new iOS developer?

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.

Does Safari support dynamic type?

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.

Does iOS support react native?

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.

Does Facebook support dynamic type?

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!


1 Answers

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>
like image 155
Nader Dabit Avatar answered Nov 09 '22 22:11

Nader Dabit