1条回答
- prettYYoyic 2013-01-28 03:16关注
用MKNumberBadgeView实现自定义的badgeView。
自定义
UITabBarController
大概如下:MKNumberBadgeView *badge = [[MKNumberBadgeView alloc] initWithFrame:CGRectMake(110, self.view.frame.size.height-20, 30, 30)]; badge.value = 12; UIWindow *window = [[UIApplication sharedApplication].windows objectAtIndex:0]; [[[window subviews] objectAtIndex:0] addSubview:badge];
效果图:
在添加badgeView时需要注意旋转问题,可以添加
MKNumberBadgeView
进行具体设置。试试吧。本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报