I can't find any reference to add a 'notification' to an icon, preferably into a UITabBar, like the image attached, number 8.开发者_运维知识库
I suppose I don't have to create manually ALL the numbers inside a circle, or create it every time I need and update the image manually with some of my icons ?
thanks,
r.
Check out the badgeValue
property of UITabBarItem
.
UITabBarItem *item = [self.tabBarController.tabBar.items objectAtIndex:0];
item.badgeValue = @"8";
Use this:
self.newsTabBarItem = (UITabBarItem *)[stTabBarController.tabBar.items objectAtIndex:1];
self.friendsTabBarItem = (UITabBarItem *)[stTabBarController.tabBar.items objectAtIndex:2];
精彩评论