xcode - 选项卡栏项目的属性检查器中的 "Badge"字段代表什么?

标签 xcode uitabbar xcode-storyboard

我熟悉徽章,并通过代码使用它们,但选项卡栏项目的属性检查器有一个徽章字段。这个字段有什么用?

enter image description here

最佳答案

用于在标签栏图标上方显示指示器。它对于通知用户某个选项卡上有新数据非常有用。

来自 UITabBarItem documentation :

Text that is displayed in the upper-right corner of the item with a surrounding red oval.

A screenshot of a tab bar icon with a badge value of 3

上面是一个标签栏项目,在 Storyboard中设置了 Badge 值为 3

(也可以使用 badgeValue 属性以编程方式设置该值。)

关于xcode - 选项卡栏项目的属性检查器中的 "Badge"字段代表什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44101554/

相关文章:

iphone - 每次在 UITabBarBased 应用程序中单击选项卡栏项目时,如何显示不同的 View ?

ios - 为什么贝塞尔曲线路径中的 hotTest/tap 检测会在以下情况下产生不准确的结果?

ios - PFInstallation 并添加指向 PFUser 的指针

iphone - 允许用户通过点击选择 UIPickerView 行

ios - UITabBarItem 图像颜色在第一次被选中后变为蓝色

swift - 回到tabBarController,swift

ios - 在 xcode 中实现登录屏幕后滑出菜单栏

Xcode 显示 "The document had 4 issues that were found and repaired./Multiple resources have the same name: groupTableViewBackgroundColor."警报

xcode - Mavericks 和 XCode 5 下 Sparkle 的 OS X 应用程序更新问题

ios - 调用 applicationDidBecomeActive 时如何通知事件 View Controller ?