小编par*_*ker的帖子

反应原生图标

有人试图使用react-native-icons?我按照以下步骤操作:

  • npm install react-native-icons @ latest --save
  • 在XCode中,在项目导航器中右键单击Libraries➜将文件添加到[您的项目名称]
  • 转到node_modules➜response-native-icons➜io并添加ReactNativeIcons.xcodeproj
  • 将libReactNativeIcons.a(从ReactNativeIcons.xcodeproj下的'Products')添加到项目的构建阶段➜链接二进制与库阶段
  • 将要使用的字体文件添加到项目的Copy Bundle Resources构建阶段(单击"+"并单击"Add Other ...",然后从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',
  }, …
Run Code Online (Sandbox Code Playgroud)

react-native

17
推荐指数
3
解决办法
3万
查看次数

标签 统计

react-native ×1