开发者

Remove Badge from tabbar item

How to Remove Badge from the tabbar item i had use below code but not working for me.

UITabBarItem开发者_JAVA百科 *chatbadge=[appDelegate.tabBarController.tabBar.items objectAtIndex:2];
chatbadge.badgeValue=nil;

Suggest any Solution.


Try doing it via the viewController:

UIViewController *viewController = [appDelegate.tabBarController.viewControllers objectAtIndex:2];

viewController.tabBarItem.badgeValue = nil;


Swift version & this is really weird

self.tabBarController?.viewControllers?[3].tabBarItem.badgeValue = nil

is working and not

self.tabBarItem.badgeValue = nil
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜