Adding number icon on top right corner of UIBarButtonItem in iphone
I want to add icon with counter开发者_运维百科(number) on top right corner of UIBarButtonItem in iphone How can i do this??
First, that's not a UIBarButton
. It's a UITabBarItem
.
If you want to do that on a UIBarButtonItem
, you're going to need to initialize it with a custom view and do a bunch of messing around.
If you want to do it with a UITabBarItem
, just do tabBarItem.badgeValue = 2;
Use the badgeValue property in UITabBarItem: http://developer.apple.com/library/ios/#documentation/uikit/reference/UITabBarItem_Class/Reference/Reference.html#//apple_ref/doc/c_ref/UITabBarItem
精彩评论