RN-全局修改文字属性:字体大小不跟随系统字体缩放
2018-12-11 本文已影响51人
精神病患者link常
app入口处
// 全局关闭字体放大缩小功能
let textRender = Text.prototype.render;
Text.prototype.render = function () {
let originText = textRender.apply(this, arguments);
return React.cloneElement(originText, {allowFontScaling: false ,style: [{includeFontPadding: false, textAlignVertical: 'center'},
originText.props.style]}, originText.props.children)
};