Reputation: 988
How can I customise the badge number on UITabBarItem?
Something like this
Upvotes: 1
Views: 1613
Reputation: 1897
Have a Look at MKNumberBadgeView. Its a little Class for your Custom BadgeView.
Using it like this I am able to add it to my custom UITabBarController:
MKNumberBadgeView *badge = [[MKNumberBadgeView alloc] initWithFrame:CGRectMake(110, self.view.frame.size.height-20, 30, 30)];
badge.value = 12;
UIWindow *window = [[UIApplication sharedApplication].windows objectAtIndex:0];
[[[window subviews] objectAtIndex:0] addSubview:badge];
Wich will look like this:
Of course you have to take care of rotating issues when adding the badgeView to the window. But I guess you can customize MKNumberBadgeView to make it look the way you want it, give it a try.
Upvotes: 6