Setting badge value in UITabBarItem in UIViewController

后端 未结 2 519
说谎
说谎 2020-12-06 01:40

I am adding UITabBarController to the window, and setting the viewControllers property of the UITabBarController to the array of ViewControllers. If i am setting the badg

相关标签:
2条回答
  • 2020-12-06 01:57

    Yes, i got the answer.

    [[self navigationController] tabBarItem].badgeValue = @"3";
    
    0 讨论(0)
  • 2020-12-06 02:08

    Or this:

    [[self.tabBarController.tabBar.items objectAtIndex:2] setBadgeValue:[NSString stringWithFormat:@"%d",[UIApplication sharedApplication].applicationIconBadgeNumber]];
    
    0 讨论(0)
提交回复
热议问题