带有Reaction导航的自定义图标5 [英] Custom icons with react navigation 5

查看:29
本文介绍了带有Reaction导航的自定义图标5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将自定义图标与Reaction选项卡栏导航一起使用。但是,所有教程和文档 始终只涵盖通过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://medium.com/bam-tech/add-custom-icons-to-your-react-native-application-f039c244386c

您需要获取.svg文件,然后使用IcoMoon之类的服务生成.ttf字体文件并将该字体加载到您的应用程序中。

这篇关于带有Reaction导航的自定义图标5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆