@qixingguaizhuang
2016-05-26T09:27:47.000000Z
字数 311
阅读 713
我们项目中会使用到 badgeValue 用于提醒个数,会遇到变为 0 后,badgeValue 隐藏的问题,可以加一个判断实现。
totleUnreadCounts 为消息个数
if (totleUnreadCounts > 0) {
self.navigationController.tabBarItem.badgeValue = [NSString stringWithFormat:@"%ld", totleUnreadCounts];
}else{
self.navigationController.tabBarItem.badgeValue = nil;
}
