»
S
I
D
E
B
A
R
«
How to set badge value of an TabBar Item
May 19th, 2009 by Anish Kumar

Many iPhone projects would require setting some numeric value on tabBarItem called badge. We can set the badge value for a tabBarItem by:-

Fig: UITabBarItem With Badges

Fig: UITabBarItem With Badges

//__tabBarController  is a outlet to our UITabBarController
__tabBarController.selectedViewController.tabBarItem.badgeValue = @”1″;
The badge value expects an string and it should be an integer. The maximum width of the badge is around 58 pixels in which approximately 7 to 9 digits fit in depending on the digits being displayed.
Too Many Digits In Badge

Too Many Digits In Badge

About Anish:
Mac OS X software development is my bread winner with over 6 years of experience. Expertise in Color Management, TWAIN Scanner drivers on Mac OS X, Photoshop Filter and Import Plugin development on Mac OS X, iPhone. As an hobby I love to work on PHP, Flex, AIR, Photoshop. Check the 'About' page for more.

2 Responses  
GarykPatton writes:
June 16th, 2009 at 7:54 am

I think I will try to recommend this post to my friends and family, cuz it’s really helpful.

CrisBetewsky writes:
July 7th, 2009 at 1:34 am

You know, I don’t read blogs. But yours is really worth beeing read.

Leave a Reply

Spam protection by WP Captcha-Free