Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Notification Icon on UITabBar

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.

alt text

like image 641
mongeta Avatar asked Feb 15 '10 08:02

mongeta


3 Answers

Check out the badgeValue property of UITabBarItem.

like image 164
kennytm Avatar answered Oct 22 '22 06:10

kennytm


 UITabBarItem *item = [self.tabBarController.tabBar.items objectAtIndex:0];  
 item.badgeValue = @"8";
like image 30
TtheTank Avatar answered Oct 22 '22 06:10

TtheTank


Use this:

self.newsTabBarItem = (UITabBarItem *)[stTabBarController.tabBar.items objectAtIndex:1];
self.friendsTabBarItem = (UITabBarItem *)[stTabBarController.tabBar.items objectAtIndex:2];
like image 24
ganesh manoj Avatar answered Oct 22 '22 06:10

ganesh manoj