Question

I have a main menu in my monotouch app that has 4 icons which go to various other screens. I would like to put an alert badge on one of the icons when my alert criteria has been met. Is there a way to do this using applicationIconBadgeNumber or something similar?

Was it helpful?

Solution

If you mean a UITabBarController than this code will do what you need

viewController.tabBarItem.badgeValue = 1;

Where the viewcontroller is the UIViewController which is associated with the tab]

If you would like to add it to a UIButton you can use this class here

That should allow you do it.

OTHER TIPS

You can't add badges to arbitrary buttons or views. You could manage it yourself. You could create the badge as an image and draw it outside your buttons bounds, at the location you want it to appear. You'll want to make sure clipToBounds is set to NO so it shows.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top