标签栏不显示图标? [英] Tab bar not showing icons?

查看:113
本文介绍了标签栏不显示图标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我阅读了一堆相关问题,我尝试了他们说的话,但实际上没有任何效果.不知道为什么.因此,我有3个不同的UIStoryboards.第一个是用于处理登录/注册的Auth故事板,其中有一个故事板引用了第二个故事板-标签栏故事板.此情节提要包含其他5个情节提要参考,它们将加载其单独的视图控制器.

I read a bunch of related questions, I tried what they said, nothing works really. Not sure why. So, I have 3 different UIStoryboards. First one is the Auth Storyboard that handles Login/Register and there's a storyboard reference to the second Storyboard - Tab bar storyboard. This storyboard contains 5 other storyboard references that would load it's separate view controllers.

我的问题是用户登录后图标不会显示.我在UITabViewController中设置了第一个视图控制器的自定义颜色,只是为了确保它已加载.是的.

My problem is that the icons are not showing once the user is logged in. I setup a custom color of the first view controller in the UITabViewController just to make sure it loads. It does.

我尝试将所有图像/图标设置为原始",但没有用.我设置了系统映像,只是为了查看是否存在问题,因此未显示它们.还值得一提的是,这些图标显示在情节提要中,但在对其进行编译时,它们在模拟器中无处可见.

I've tried to setting all images/icons to render them as "Original", didn't work. I set a system image, just to see if that's the issue, they are not shown. Also worth mentioning is that the icons are shown in the storyboard but when its being compiled, they're nowhere to be seen in the simulator.

我在做什么错了?

PS:我已经更改了标签栏的颜色,只是为了对其进行测试,并且它可以工作.因此,问题不在于此...

PS: I've changed the tint color of the tab bar, just to test it, and it works. So, the problem is not with that...

推荐答案

存在情节提要引用和缺少标签栏图标的问题

如果在标签栏"控制器上附加了情节提要引用,您将注意到该情节提要引用实际上具有 UITabBarItem :

请勿为此伪造"商品设置属性. UITabBarItem!

运行该应用程序时,您的设置完全无效.您提供的值仅会影响您在Interface Builder中看到的内容,而不影响运行时在应用程序中看到的内容.

Your settings will do nothing at all when you run the app. The values you provide ONLY affect what you see in Interface Builder, not your app when you run it.

您需要做的是转到情节提要参考指向的ACTUAL视图控制器.该视图控制器上还将具有一个UITabBarItem.这是真实的"信息. UITabBarItem.在此处设置属性(图标,标题等),然后在运行应用程序时会看到它们的显示.

What you need to do is go to the ACTUAL view controller that your storyboard reference is pointing to. That view controller will also have a UITabBarItem on it. This is the "real" UITabBarItem. Set your properties (icon, title, etc.) there and you will see them show when you run the app.

这篇关于标签栏不显示图标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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