react-native-vector-icon 不能正常工作
react-native-vector-icon does not work properly
我正在使用来自类型 ('mask') 的 react-native 图标。但是,当我 运行 应用程序时,该图标不会显示。
icon to the left
任何人都可以提供建议,问题可能是什么?
密码是:
import Icon from 'react-native-vector-icons/Entypo'
<Icon name={'mask'} size={23} color={'rgba(255, 255, 255, 1)'}
style={styles.usernameIcon}/>
通过将以下代码添加到 android/app/build.gradle
来解决它
project.ext.vectoricons = [
iconFontNames: [ 'MaterialIcons.ttf', 'EvilIcons.ttf', 'AntDesign.ttf', 'Entypo.ttf', 'EvilIcons.ttf', 'Feather.ttf', 'FontAwesome.ttf', 'FontAwesome5_Brands.ttf', 'FontAwesome5_Regular.ttf', 'FontAwesome5_Solid.ttf', 'Foundation.ttf', 'Ionicons.ttf', 'MaterialCommunityIcons.ttf', 'SimpleLineIcons.ttf', 'Octicons.ttf', 'Zocial.ttf' ]
]
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
我正在使用来自类型 ('mask') 的 react-native 图标。但是,当我 运行 应用程序时,该图标不会显示。 icon to the left
任何人都可以提供建议,问题可能是什么?
密码是:
import Icon from 'react-native-vector-icons/Entypo'
<Icon name={'mask'} size={23} color={'rgba(255, 255, 255, 1)'}
style={styles.usernameIcon}/>
通过将以下代码添加到 android/app/build.gradle
来解决它project.ext.vectoricons = [
iconFontNames: [ 'MaterialIcons.ttf', 'EvilIcons.ttf', 'AntDesign.ttf', 'Entypo.ttf', 'EvilIcons.ttf', 'Feather.ttf', 'FontAwesome.ttf', 'FontAwesome5_Brands.ttf', 'FontAwesome5_Regular.ttf', 'FontAwesome5_Solid.ttf', 'Foundation.ttf', 'Ionicons.ttf', 'MaterialCommunityIcons.ttf', 'SimpleLineIcons.ttf', 'Octicons.ttf', 'Zocial.ttf' ]
]
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"