tabbar的BadgeValue 显示位置问题
abbar的BadgeValue 显示位置问题
1.在iOS 7.0的时候 tabbar item上的badgevalue显示正常 如图:
2.在iOS 7.1的时候 tabbar item上的badgevalue显示位置异常 如图:
不知道有没有解决办法。
设置代码:[[self.tabBar.items objectAtIndex:2] setBadgeValue:@"10"];
及自定义tabbar中viewdidload部分代码:
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
//tabbar背景
UIImage *image = [UIImage imageNamed:@"背景.png"];
UIImage *back_img=[image TransformtoSize:CGSizeMake(320 , 49)];
[self.tabBar setBackgroundImage:back_img];
// Creat items on tab bar
UIImage *image1_0 = [[UIImage imageNamed:@"下导航-拼酒店.png"] TransformtoSize:CGSizeMake(80, 55)];//transformtosize的功能是将图片大小转化
UIImage *image1_1 = [[UIImage imageNamed:@"下导航-拼酒店1.png"] TransformtoSize:CGSizeMake(80, 55)];
[(UITabBarItem *)[self.tabBar.items objectAtIndex:0] setFinishedSelectedImage:image1_0 withFinishedUnselectedImage:image1_1];
// Creat items on tab bar
UIImage *image2_0 = [[UIImage imageNamed:@"下导航-我的发布.png"] TransformtoSize:CGSizeMake(80, 55)];
UIImage *image2_1 = [[UIImage imageNamed:@"下导航-我的发布1.png"] TransformtoSize:CGSizeMake(80, 55)];
[(UITabBarItem *)[self.tabBar.items objectAtIndex:1] setFinishedSelectedImage:image2_0 withFinishedUnselectedImage:image2_1];
// Creat items on tab bar
UIImage *image3_0 = [[UIImage imageNamed:@"下导航-消息.png"] TransformtoSize:CGSizeMake(80, 55)];
UIImage *image3_1 = [[UIImage imageNamed:@"下导航-消息1.png"] TransformtoSize:CGSizeMake(80, 55)];
[(UITabBarItem *)[self.tabBar.items objectAtIndex:2] setFinishedSelectedImage:image3_0 withFinishedUnselectedImage:image3_1];
// Creat items on tab bar
UIImage *image4_0 = [[UIImage imageNamed:@"下导航-酒店预订.png"] TransformtoSize:CGSizeMake(80, 55)];
UIImage *image4_1 = [[UIImage imageNamed:@"下导航-酒店预订1.png"] TransformtoSize:CGSizeMake(80, 55)];
[(UITabBarItem *)[self.tabBar.items objectAtIndex:3] setFinishedSelectedImage:image4_0 withFinishedUnselectedImage:image4_1];
// Creat items on tab bar
UIImage *image5_0 = [[UIImage imageNamed:@"下导航-个人中心.png"] TransformtoSize:CGSizeMake(80, 55)];
UIImage *image5_1 = [[UIImage imageNamed:@"下导航-个人中心1.png"] TransformtoSize:CGSizeMake(80, 55)];
[(UITabBarItem *)[self.tabBar.items objectAtIndex:4] setFinishedSelectedImage:image5_0 withFinishedUnselectedImage:image5_1];
[[self.tabBar.items objectAtIndex:2] setBadgeValue:@"10"];
}