如何从标签栏项目中删除徽章,我使用了下面的代码,但对我不起作用。
UITabBarItem *chatbadge=[appDelegate.tabBarController.tabBar.items objectAtIndex:2];
chatbadge.badgeValue=nil;
建议任何解决方案。
发布于 2010-03-19 23:44:33
尝试通过viewController执行此操作:
UIViewController *viewController = [appDelegate.tabBarController.viewControllers objectAtIndex:2];
viewController.tabBarItem.badgeValue = nil;
发布于 2017-08-31 22:29:12
Swift版本&这真的很奇怪
self.tabBarController?.viewControllers?[3].tabBarItem.badgeValue = nil
正在工作,而不是
self.tabBarItem.badgeValue = nil
https://stackoverflow.com/questions/2476903
复制相似问题