美文网首页
iOS--badgeValue(角标)

iOS--badgeValue(角标)

作者: 丶大明 | 来源:发表于2016-11-28 09:01 被阅读209次

//通知传值

NSString *badgeNum =[NSString stringWithFormat:@"%@",[getMsgNum valueForKey:@"object"]];

UIViewController *tController = [self.tabBarController.viewControllers objectAtIndex:3];

int badgeValue = [badgeNum intValue];

if (badgeValue >0) {

tController.tabBarItem.badgeValue = [NSString stringWithFormat:@"%d",badgeValue];

}else{

tController.tabBarItem.badgeValue = nil;

}

做下笔记,省得忘了O(∩_∩)O哈哈~

相关文章

网友评论

      本文标题:iOS--badgeValue(角标)

      本文链接:https://www.haomeiwen.com/subject/zntopttx.html