English
English
简体中文
Register
Log In
English
English
简体中文
Register
Log In
Language
English
English
简体中文
Register
Log In

The font is cut off on some Android phones

Last Updated on2022-05-17 06:18:29
This is caused by the system default fonts of some Android phones. We can insert this code in src/composeLayout.js in the project:
// Solve the problem that the width of Text is truncated in a certain model and certain font

if (Platform.OS !== 'web') {
  const originRender = Text.render || Text.prototype.render;
  const parent = Text.render ? Text : Text.prototype;
  parent.render = function(...args) {
    const origin = originRender.call(this, ...args);
    return React.cloneElement(origin, {
      style: [!isIos && { fontFamily: '' }, origin.props.style],
    });
  };
}

Click for services and help

Help Center