React Native 设置字体不随系统字体大小改变
新建一个config.js文件,添加一下代码:
import { Text, TextInput } from 'react-native'
//Font setting will not automatically adjust
if (!Text.defaultProps) Text.defaultProps = {};
if (!TextInput.defaultProps) TextInput.defaultProps = {};
Text.defaultProps.allowFontScaling = false
TextInput.defaultProps.allowFontScaling = false
在index.js中引入
import './config'