gpt4 book ai didi

ios - 选项卡栏项目 - 选定/未选定图标

转载 作者:可可西里 更新时间:2023-11-01 03:56:54 27 4
gpt4 key购买 nike

在 Xcode 6 中,您现在可以为选项卡项目的选中和未选中状态设置图标。请参阅下图中的说明:

Selected Image - The image displayed when the tab bar item is selected.

Image - The image used to represent the item.

唯一的问题是 SELECTED 状态的图像不显示。它只是显示空白。还有其他人有这个问题吗?请看下面的结果截图:

REPORT tab is UNSELECTED

REPORT tab is SELECTED

谢谢!!!

最佳答案

所以解决这个问题的方法:

  1. 使用要在属性检查器的“BAR ITEM”部分中使用的默认未选中图标图像设置选项卡:

enter image description here

  1. 点击 Identity Inspector,然后在“USER DEFINED RUNTIME ATTRIBUTES”下点击 + 以添加新值。

KEYPATH:selectedImage(必须是这个!!!)

类型:图片

VALUE:您选择/突出显示的图标图像的名称。我将 Images.xcassets 用于我的图像 Assets 。

enter image description here

运行您的应用。您会注意到图像更改为所选版本(而不仅仅是它的突出显示版本。

像魅力一样工作。

关于ios - 选项卡栏项目 - 选定/未选定图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26999899/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com