iOS 8 : Selected image for custom tab bar item set in interface builder does not work

标签 ios uitabbaritem

我已将 Storyboard 选项卡栏项目设置为自定义,将图像设置为我的轮廓图像,将所选图像设置为我的填充图像,但是当我运行该应用程序时,所选图像没有显示。

如果我使用 UITabBarItem(title: String?, image: UIImage?, selectedImage: UIImage?)

我使用 Xcode 6.1.1。

有什么问题吗?

最佳答案

我认为,这是 Xcode 的一个错误,如果您添加类型为 Image 且 keyPath 为“selectedImage”的用户定义的运行时属性,您将可以设置图像。
这里是选项卡式应用程序模板的示例,在第二个选项卡上带有自定义选择的图像(我使用第一个选项卡中的图像): enter image description here

关于iOS 8 : Selected image for custom tab bar item set in interface builder does not work,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28215541/

相关文章:

ios - UITabBar在iOS 7中的行为很奇怪,如何解决?

iphone - 伊塔巴尔和伊塔巴里特姆

ios - Swift 中的 UITabBarItem 图像插入问题

ios - 如何在真实设备上设置 Frank Automation?

ios - 推送到 github 时是否保存包含 AWS Cognito Identity Pool ID

ios - 尝试访问已注册单元格的成员时出现运行时错误

ios - 选择指标图像

ios - 如何更改 "share your information"中的公司名称以在 iTunes 中自动续订?

ios - 如何调整 UITableView 中原型(prototype)单元格的左边距?

xcode - 在 Swift 中更改特定 TabBarItem 的颜色