【发布时间】:2019-09-25 09:49:29
【问题描述】:
我在snack expo 中使用fontawsome 图标构建了布局,但是在expo cli 中运行相同的项目时,图标不显示。它显示为交叉。应用程序在snack 中完美运行,但在expo cli 中没有。我尝试过google问题,但解决方案是在 gradle 中更改文件,我没有 gardle 文件,这是一个小吃项目。有什么解决方案,任何帮助都会很好,谢谢。
import Icon from 'react-native-vector-icons/FontAwesome';
{
Home: {
screen: FetchNewsApp,
navigationOptions: {
tabBarLabel: 'Home',
tabBarIcon: ({ tintColor }) => (
<Icon name="home" color={tintColor} size={25} />
),
},
},
Explore: {
screen: ExploreScreenApp,
navigationOptions: {
tabBarLabel: 'Explore',
tabBarIcon: ({ tintColor }) => (
<Icon name="wpexplorer" color={tintColor} size={25} />
),
},
},
Search: {
screen: SearchScreenApp,
navigationOptions: {
tabBarLabel: 'Search',
tabBarIcon: ({ tintColor }) => (
<Icon name="search" color={tintColor} size={25} />
),
},
},
Settings: {
screen: SettingScreenApp,
navigationOptions: {
tabBarLabel: 'Settings',
tabBarIcon: ({ tintColor }) => (
<Icon name="cog" color={tintColor} size={25} />
),
},
},
Profile: {
screen: ProfileScreenApp,
navigationOptions: {
tabBarLabel: 'Profile',
tabBarIcon: ({ tintColor }) => (
<Icon name="user-circle" color={tintColor} size={25} />
),
},
},
},
{
initialRouteName: 'Home',
}
);
【问题讨论】:
-
发布一些代码。
-
和导入声明
-
在问题中添加代码而不是在 cmets 中
标签: react-native icons expo react-native-vector-icons