Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to set the badgevalue in tabbar in iphone?

I am using the following code to set the badgevalue in current tab bar but its not visible in tab bar

self.navigationController.tabBarItem.badgeValue = @"1"

what is the correct way of putting the badge value in the tab bar.

like image 810
uttam Avatar asked Jan 29 '26 17:01

uttam


1 Answers

This is how I access the badgeValue on a tabBarItem:

UITabBarItem * tabBarItem = (UITabBarItem *)[aTabBarController.tabBar.items objectAtIndex:1];
tabBarItem.badgeValue = @"1";
like image 115
Tom Irving Avatar answered Feb 01 '26 07:02

Tom Irving



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!