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;
Here's my question:
Why's the badge value 1
on my phone not in the correct position?
And how to solve it?
The day before the yesterday i faced the same problem, you can have a look in 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;
}