1

three

Here's the code in my AppDelegate.m:

RootTableViewController *fcTableViewController = [[RootTableViewController alloc]
                                                  initWithStyle:UITableViewStylePlain];
fcTableViewController.title = @"root";
UINavigationController *fcNavigationController = [[UINavigationController alloc]
                                                  initWithRootViewController:fcTableViewController];
fcNavigationController.navigationBar.translucent = NO;
fcNavigationController.tabBarItem.badgeValue = @"0";

// ?
fcNavigationController.tabBarItem.image = [[UIImage imageNamed:@"icon1"]
                                           imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
fcNavigationController.tabBarItem.imageInsets = UIEdgeInsetsMake(6, 0, -6, 0);

FaiChouViewController *fcViewController = [[FaiChouViewController alloc] init];
UINavigationController *fcNController = [[UINavigationController alloc] initWithRootViewController:fcViewController];
fcNController.navigationBar.translucent = YES;
fcNController.tabBarItem.badgeValue = @"1";
// ...
UITabBarController *fcTabBarController = [[UITabBarController alloc] init];
fcTabBarController.viewControllers = @[fcNavigationController, fcNController, fcpNavigationController];

self.window.rootViewController = fcTabBarController;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions;

Here's my question:

Why's the badge value 1 on my phone not in the correct position?

And how to solve it?

FaiChou
  • 767
  • 7
  • 16
  • 2
    Please post code, not a screen shot – Paulw11 May 27 '16 at 01:54
  • Badge value 1 is showing fine on iPhone 5 and 6 but not on iPod. what your question is actually? your question is "Why's the badge value 1 on my phone not in the correct position?" whats does it mean? where you want your badge value? – Santo May 27 '16 at 07:30

1 Answers1

0

The day before the yesterday i faced the same problem, you can have a look in here

Demo

enter image description here

Only two line of code can get you started

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

  //supplying the animation parameter
  [UITabBarItem setDefaultAnimationProvider:[[DefaultTabbarBadgeAnimation alloc] init]];
  [UITabBarItem setDefaultConfigurationProvider:[[DefaultSystemLikeBadgeConfiguration alloc] init]];

  //rest of your code goes following...

  return YES;
}
Community
  • 1
  • 1
Ratul Sharker
  • 7,484
  • 4
  • 35
  • 44