Abhinandan
Abhinandan

Reputation: 23

Notification icon

How can i add notification icon on a button..I m able to add it on application icon but not on the button...Help me pls...

UIApplication *application = [UIApplication sharedApplication];
application.applicationIconBadgeNumber = 1; // set to any integer

I m using this code.. Thank you....

Upvotes: 2

Views: 740

Answers (2)

Max
Max

Reputation: 16719

You can use some custom views. Here is the nice one: link

Upvotes: 2

Anomie
Anomie

Reputation: 94814

While some classes may have private APIs to add such icons, I believe the only class that publicly supports it is UITabBarItem.

Your best bet would be to create your own custom view class that draws the icon appropriately, and then layer it on top of your button (e.g. by adding it as a subview of the button at the proper position).

Upvotes: 0

Related Questions