2
我想知道如何设置UIButton徽章像UITabBarController徽章?如何在像UITabBarController这样的UIBarbutton上添加徽章?
我想知道如何设置UIButton徽章像UITabBarController徽章?如何在像UITabBarController这样的UIBarbutton上添加徽章?
你只是想一个背景图像添加到按钮
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];
您可以使用MKNumberBadgeView。
参见答案[这个问题] [1]上SO [1]:http://stackoverflow.com/questions/4722669/how-can-i-add-a-badge-到-A-标准的UIButton – FluffulousChimp 2012-03-12 21:15:41