简体   繁体   English

嵌套 react-navigation 栏中未显示图标

[英]Icons not showing in nested react-navigation bar

Following the example of this docs page from React Navigation , I created a nested bottom navigation system for my React Native app (simplified version of my code can be seen and tested here ).按照来自React Navigation这个文档页面的示例,我为我的 React Native 应用程序创建了一个嵌套的底部导航系统(可以在此处查看和测试我的代码的简化版本)。 However, I have noticed that the icons for the pages shown in the navigation bar are the typical question mark symbols (on iOS) that show when the image is not recognized:但是,我注意到导航栏中显示的页面图标是典型的问号符号(在 iOS 上),当无法识别图像时会显示: 这个图片

However, if I use a simple navigation bar, with no nesting, the icons are shown no problem.但是,如果我使用没有嵌套的简单导航栏,则图标显示没有问题。 Any ideas on how to fix this?有想法该怎么解决这个吗?

I found out what the problem was: I was adding the icon into the deepest (second) layer of the navigation bar.我发现了问题所在:我将图标添加到导航栏的最深(第二)层。 When using nested navigation bars, the icons must be placed in the highest level navigation layer.使用嵌套导航栏时,图标必须放在最高级的导航层。 Here is a working version of the previous example, with the appropriate correction.是上一个示例的工作版本,并进行了适当的更正。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM