0

我的应用中有一个带有样式的简单文本组件。如果我添加 fontweight: 'bold',最后一个字符(有时是整个单词)就会消失。

两个示例文本组件:

<Text style={styles.price}>{priceDisplay(deal.price)}</Text>
<Text style={styles.cause}>{deal.cause.name}</Text>

这两个的样式:

  cause: {
    fontSize: 14,
    fontWeight: 'bold',
  },
  price: {
    fontSize: 16,
    textAlign: 'center',
    fontWeight: 'bold',
  },

没有 fontweight
有 fontweight \

提前致谢。

编辑:问题来自我的 OnePlus 智能手机,它以 OnePlus-Slate 字体为标准。该字体会导致问题。如果我将代码中的字体更改为“Roboto”之类的字体,则字体粗体将起作用。

4

1 回答 1

0

以下是更改项目默认字体的说明:https ://ospfolio.com/two-way-to-change-default-font-family-in-react-native/#why-do-myapp-sometimes-get -texts-cut-off-on-some-android-phone 或者,您可以更改手机中的字体。

于 2021-04-17T12:38:33.557 回答