有人try 使用本 map 标吗?我遵循以下步骤:

  • npm安装react 本机-icons@latest——救命
  • 在XCode中,在项目导航器中右键单击库➜ 将文件添加到[项目名称]
  • 转到 node _模块➜ react 本机图标➜ ios和添加ReactNativeIcons.xcodeproj
  • 添加LibReactNativeCons.a(从ReactNativeIcons.xcodeproj下的"产品"到项目的构建阶段)➜ 将二进制文件链接到库阶段
  • 将要使用的字体文件添加到项目的复制包资源构建阶段(单击"+"并单击"添加其他…",然后从 node _modules/react native icons/ios/Libraries/FontAwesomeKit中 Select 字体文件).

我的密码

var React = require('react-native');
var Icon = require('FAKIconImage');
var { AppRegistry, StyleSheet, Text, View} = React;

class BringgersApp extends React.Component {

  constructor(props) {
    super(props);
  }

  render() {
    return(
      <View style={styles.container}>        
        <Text style={styles.welcome}>
          Welcome to Bringgers!          
        </Text>
        <Icon
          name='ion|beer'
          size={150}
          color='#887700'
          style={styles.beer} />       
      </View>
    )
  }
}

var styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  welcome: {
    fontSize: 20,
    textAlign: 'center',
    margin: 10,
  },
  instructions: {
    textAlign: 'center',
    color: '#333333',
    marginBottom: 5,
  },
});

React.AppRegistry.registerComponent('BringgersApp', function() { return BringgersApp });

我建立后,他说文件不存在...

Font file doesn't exist

我清理衍生数据并多次try 构建,但都不起作用.

推荐答案

第一件事,

  • react-native-icons的维护者自己指出了更新的&;维持react-native-vector-icons
  • 显然,到目前为止,rnpm项目已经并入react native.

换句话说,你的生活就像打字一样简单

react-native install react-native-vector-icons
react-native link react-native-vector-icons

你可能很乐意go *)

*) at least it worked on my machine

React-native相关问答推荐

原生react :顶部的滑块位置

react 在顶部选项卡导航中传递本机数据

莫迪德不会停留在屏幕中央

将值从一个 js 文件传递​​到 react native 中的另一个 js 文件:react native

每当我在 React Native Tab Navigator 中切换标签时触发 UseEffect

任务:react-native-async-storage_async-storage:generateReleaseRFile FAILED

如何在react-native 的switch 内显示文本(是/否)

如何在 react-native 中获取组件的大小?

React Native 错误找不到模块metro-config/src/defaults/blacklist

React Native - NSNumber 无法转换为 NSString

cmd : react-native run-android 在每次文件更改时

试图注册两个具有相同名称 ProgressBarAndroid 的视图

React Native:ScrollView 中的 TouchableOpacity onPress 问题

ScrollView bounce的 2 种不同背景 colored颜色

将 react-native 元素Bundle 为 iOS 框架或 (.aar) Android 库

使用来自另一个页面的 fetch 调用函数返回结果值

是否需要使用 StyleSheet.create?

React Native 动画 - zoom 时 translateX 和 translateY

React Native 不支持在 Windows 上开发?

如何用 Realm 元素文件组织 React Native?