我想在react标签栏导航中使用自定义图标。但是,所有的教程和文档都只涉及Ionicons或Materialdesign的图标。有什么方法可以实现我自己的图标吗?
目前的代码是这样的。
<Tab.Navigator tabBarOptions={{
inactiveTintColor: '#707070',
activeTintColor: 'red',
style: {
backgroundColor: '#F1F1F1',
height: 60,
color: 'red',
paddingBottom: 5
}
}}>
<Tab.Screen name="Bestellungen" component={BestellungenOverview}/>
<Tab.Screen name="Kunden" component={KundenOverview} />
<Tab.Screen name="Zahlungen" component={ZahlungenOverview} />
<Tab.Screen name="Statistiken" component={StatistikenOverview} />
<Tab.Screen name="Einstellungen" component={Einstellungen} />
</Tab.Navigator>
你需要将你的图标保存为一种字体。查看这些链接,看看是否有帮助。
https:/medium.comam-techadd-custom-icons-to-your-react-native-application-f039c244386c。
你需要把你的.svg文件,并使用像IcoMoon这样的服务,生成一个.ttf字体文件,并将该字体加载到你的应用程序中。