我正在尝试将自定义图标与反应选项卡导航一起使用。但是,所有教程和文档
总是只涵盖通过 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://www.reactnative.guide/12-svg-icons-using-react-native-vector-icons/12.1-creating-custom-iconset.html https://www.reactnative.guide/12-svg-icons-using-react-native-vector-icons/12.1-creating-custom-iconset.html
https://medium.com/bam-tech/add-custom-icons-to-your-react-native-application-f039c244386c https://medium.com/bam-tech/add-custom-icons-to-your-react-native-application-f039c244386c
您需要获取 .svg 文件,并使用 IcoMoon 等服务生成 .ttf 字体文件并将该字体加载到您的应用程序中。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)