我的应用中有一个带有样式的简单文本组件。如果我添加 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',
},
提前致谢。
编辑:问题来自我的 OnePlus 智能手机,它以 OnePlus-Slate 字体为标准。该字体会导致问题。如果我将代码中的字体更改为“Roboto”之类的字体,则字体粗体将起作用。