【发布时间】:2022-02-05 05:11:20
【问题描述】:
在 css styleSheet 中设置字体系列以在 WebView 中呈现 html 时,我遇到了一个奇怪的问题。 我在 xcode 中导入了 2 种字体(Arial Rounded MT Bold 和 Arial Rounded MT)。这些字体在 Text 组件中完美运行,但在 WebView 中,只有 Arial Rounded MT Bold 有效。我用它来设置字体:
const styleSheet = `* {
font-family: "Arial Rounded MT Bold";
font-size: 11px;
color: ${appColors.textGrey};
}`
知道如何使 Arial Rounded MT 工作吗?
【问题讨论】:
-
将字体添加到
Info.plist,并且字体也必须是打印UIFont.familyName时在iOS中打印的姓氏 -
我已经做到了。正如我所写,字体在本机组件中工作,只有 Arial Rounded MT 未应用于 webView。
标签: css ios react-native