加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

react-native – 反应本机图标

发布时间:2020-12-15 20:42:37 所属栏目:百科 来源:网络整理
导读:有人尝试使用反应本机图标?我按照这些步骤: npm install react-native-icons @ latest –save 在XCode中,在项目导航器中,右键单击库?将文件添加到[您的项目名称] 转到node_modules?react-native-icons?ios并添加ReactNativeIcons.xcodeproj 将libReactNati
有人尝试使用反应本机图标?我按照这些步骤:

> npm install react-native-icons @ latest –save
>在XCode中,在项目导航器中,右键单击库?将文件添加到[您的项目名称]
>转到node_modules?react-native-icons?ios并添加ReactNativeIcons.xcodeproj
>将libReactNativeIcons.a(从“ReactNativeIcons.xcodeproj下的”Products“)添加到项目的构建阶段?链接二进制库与库阶段
>将您要使用的字体文件添加到项目的“复制包资源”构建阶段(单击“’并单击”添加其他…“,然后从node_modules / react-native-icons / ios / Libraries中选择字体文件/ FontAwesomeKit).
运行你的项目(Cmd R)

我的代码

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

我清理DerivedData并尝试构建很多次,但不起作用.

首先,

>反馈 – 本土图标的维护者指向较新的&维持react-native-vector-icons
>显然,截至目前,rnpm项目已经合并为反应性.

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

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

你可能会很好* *

*)至少它在我的机器上工作

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读