UITabBarItem 不更新图像 [英] UITabBarItem does not update image

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

问题描述

出于某种原因,我的 UITabBarItem 只有一张图片没有显示.在我重构故事板以组织它们之后,这开始发生.当我运行应用程序时,调试器没有触发任何消息,它只是不显示.图像正在故事板中设置,没有以编程方式设置它.它显示在 Interface Builder 中,但当我运行应用程序时却没有.

For some reason, only one image of my UITabBarItem does not show up. This started to happen after I refactored the storyboards to organize them. When I run the app, no message is triggered to the debugger, it just don't show up. The image is being set in storyboard and nothing programmatically is being done to set it. It shows up in Interface Builder, but when I run the app it doesn't.

已经尝试删除目录中的图像,重命名并执行清理,但没有任何帮助.

Already tried delete the image in catalog, rename it and perform clean up, but nothing helped.

推荐答案

在我重构我的故事板之后,出于某种原因,有问题的故事板中的 Tab Bar 被删除了.这足以隐藏"图像.在它的导航控制器上添加一个新的 UITabBarItem 并在那里配置图像解决了我的问题.

After I refactored my storyboards, for some reason, the Tab Bar from the storyboard with the problem was removed. That was enough to "hide" the image. Adding a new UITabBarItem on it's navigation controller and configuring the image there solved my problem.

这篇关于UITabBarItem 不更新图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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