gpt4 book ai didi

react-native - 带有反应导航的自定义图标 5

转载 作者:行者123 更新时间:2023-12-04 15:29:23 24 4
gpt4 key购买 nike

我正在尝试将自定义图标与 React 标签栏导航结合使用。但是,所有教程和文档总是只覆盖通过 Ionicons 或 Materialdesign 实现图标。有什么方法可以实现我自己的图标吗?

这是代码看起来像 atm 的样子:

<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://medium.com/bam-tech/add-custom-icons-to-your-react-native-application-f039c244386c

您需要获取您的 .svg 文件,并使用像 IcoMoon 这样的服务生成一个 .ttf 字体文件并将该字体加载到您的应用程序中。

关于react-native - 带有反应导航的自定义图标 5,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61566923/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com