我已经安装了React原生矢量图标,我已经更改了android/app/build.gradle添加应用从:“../../节点模块/React Native矢量图标/字体.gradle”.
当我尝试导入文件中的图标时(例如):
import React from 'react';
import {StatusBar, StyleSheet, Text, FlatList, View, TextInput, Button} from 'react-native';
import { Ionicons } from "react-native-vector-icons/MaterialIcons";
const HomeScreen = () => {
return (
<View style={styles.page}>
<Ionicons name="ios-camera-reverse" />
</View>
);
};
export default HomeScreen;
then i got an error (screen).[enter image description here][1]
I have installed React Native Vector Icons, I have changed the android/app/build.gradle adding **apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"**.
[1]: https://i.stack.imgur.com/eNps6.png
1条答案
按热度按时间ui7jx7zq1#
尝试更改导入:
在此处检查默认导入:https://github.com/oblador/react-native-vector-icons/blob/master/MaterialIcons.js