react-native-vector-icons/Feather 图标未显示

3
我已将我的应用程序升级到RN版本0.60.5,并使用react-native-vector-icons/Feather作为图标。在升级之前,图标显示正常,但之后,我看到的是方块而不是图标:

enter image description here

我像这样使用它:
import Icon from 'react-native-vector-icons/Feather';
.
.
.
 return (
   <TouchableOpacity onPress={() => this.btnPressed('Discover')} style={[styles.btn, { marginLeft: 20 }]}>
     <Icon name={'compass'} color={this.state.discoverSelected ? this.props.activeTintColor : this.props.inactiveTintColor} size={24} />
     <Text style={[styles.btnTxt, { color: this.state.discoverSelected ? this.props.activeTintColor : this.props.inactiveTintColor }]}>Discover</Text>
   </TouchableOpacity>
)

这可能是什么原因呢?


你尝试过使用 react-native link 吗? - OriHero
是的 @AbdumutalAbdusamatov - Tal
1个回答

1
我之前遇到过同样的问题,通过按照官方安装文档进行操作解决了该问题。对于iOS,使用cocoapods选项;对于Android,使用gradle选项。请注意,不要更改文本中的HTML标记。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接