reactjs 尝试使用垂直图标时显示“这些文件不存在”

dbf7pr2w  于 2022-12-12  发布在  React
关注(0)|答案(1)|浏览(118)

我已经安装了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
ui7jx7zq

ui7jx7zq1#

尝试更改导入:

import Ionicons from "react-native-vector-icons/MaterialIcons";

在此处检查默认导入:https://github.com/oblador/react-native-vector-icons/blob/master/MaterialIcons.js

相关问题