天道酬勤,学无止境

context-configuration

How do I prevent Android device Display size scaling in my app?

I'm developing an app with React Native for both iOS and Android, and I am trying to prevent device-specific scaling of the display in the app. For text/font size scaling, putting the following code in the root-level App.js file solves the issue for both iOS and Android: if (Text.defaultProps == null) { Text.defaultProps = {}; } Text.defaultProps.allowFontScaling = false; However, Android devices have the following Display size setting that is still being applied: I've tried (unsuccessfully) to piece together a variety of "solutions" to this issue that I've found in answers to the following

2021-04-19 18:22:50    分类:问答    android   android-layout   react-native-android   android-context   context-configuration