我想知道如何为UIButton设置徽章,如UITabBarController Badge?
答案 0 :(得分:0)
您只想将背景图像添加到按钮
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];
答案 1 :(得分:0)
您可以使用MKNumberBadgeView。