How to stop app from crashing when device font scale changes?

268 Views Asked by At

I'm new to React Native and I've been trying to prevent my app from crashing when the system font scaling increases. I've looked at various answers on different platforms, but I haven't found the right solution yet. Could someone please help me resolve this issue?

"react-native": "^0.67.5",

I've tried using android:configChanges="fontScale" as suggested in some stack answers, which does prevent the app from crashing. However, the React Native app itself doesn't adapt to the font scale size of the device.

1

There are 1 best solutions below

0
On

I will try this in AndroidManifest.xml file.

<activity

...

android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|fontScale"

... android:launchMode="singleTask"

....

This is working for me.