[英]UITabBar badge position in iOS7
反正有什么位置UITabBar徽章? 在iOS7中看起来几乎没有位移。 在iOS7中,它移至下一个标签栏项目。
我使用了自定义标签栏项目。
UINavigationController *navController = [self.viewControllers objectAtIndex: 0];
UIViewController *viewController = [navController.viewControllers objectAtIndex:0];
CustomTabBarItem *tabBarItem = [[CustomTabBarItem alloc] initWithTitle:EMPTY_STRING image: nil tag:2];
[tabBarItem setImageInsets:UIEdgeInsetsMake(-14.5, 0, 14.5, 0)];
tabBarItem.customHighlightedImage= [UIImage imageNamed: @"icon_on.png"];
tabBarItem.customStdImage = [UIImage imageNamed:@"icon_off.png"];
viewController.tabBarItem = tabBarItem;
使用不推荐使用的方法setFinishedSelectedImage和withFinishedUnselectedImage时出现此问题。 而是使用setImage(imageWithRenderingMode)和setSelectedImage(imageWithRenderingMode)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.