2

I want to know how can i set a badge to UIButton like UITabBarController Badge?

keep on you
  • 310
  • 6
  • 21
  • See the answers to [this question][1] on SO [1]: http://stackoverflow.com/questions/4722669/how-can-i-add-a-badge-to-a-standard-uibutton – FluffulousChimp Mar 12 '12 at 21:15

2 Answers2

0

You just want to add a background image to a button

    UIImage *image = [UIImage imageNamed:@"YourBadge.png"];
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = CGRectMake(200.0, 10.0, 20.0, 20.0); // or whatever dimensions you want
    [button setBackgroundImage:image forState:UIControlStateNormal];
Peter Kelly
  • 14,253
  • 6
  • 54
  • 63
0

You can use MKNumberBadgeView.

fbernardo
  • 10,016
  • 3
  • 33
  • 46