Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以在界面生成器(Xcode4)中制作的 TabBar 上可编程设置徽章值。我有四个选项卡,如果选项卡后面的收件箱中有未读项目,我希望在第四个选项卡上有一个徽章。
还是我必须通过代码重建标签栏才能做到这一点?
感谢您对此的任何想法。
您可以将其设置为 -
UITabBarItem *tbi = (UITabBarItem*)[[[self.tabBarController tabBar] items] objectAtIndex:3]; [tbi setBadgeValue:@"1"];