正文
在App.js入口文件中添加如下配置:
import React, { Component } from 'react';
import { View, Platform, Text } from 'react-native';
const styles = StyleSheet.create({
defaultFontFamily: {
fontFamily: '',
},
});
const oldRender = Text.prototype.render;
Text.prototype.render = function (...args) {
const origin = oldRender.call(this, ...args);
return React.cloneElement(origin, {
style: [origin.props.style, styles.defaultFontFamily],
});
};
若还不行,试试在对应的Text上添加入下属性
<Text numberOfLines={0} textBreakStrategy='simple' >
...
</Text>
也可以在内容文字后方加上空格