【问题标题】:react-native-vector-icons/Feather icons are not displayedreact-native-vector-icons/羽毛图标不显示
【发布时间】:2019-09-07 13:03:07
【问题描述】:

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

我是这样使用的:

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吗?
  • 是的@AbdumutalAbdusamatov

标签: android reactjs react-native react-native-vector-icons


【解决方案1】:

我之前遇到过同样的问题,我按照官方安装文档解决了 通过使用 option-with-cocoapods 用于 iOS 和 option-with-gradle 安卓版

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多