UITableBar
if ([[[UIDevice currentDevice] systemVersion] floatValue]<5.0)
{
self.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"群组" image:[UIImage imageNamed:@"首页2"] tag:0];
}
else
{
[self.tabBarItem setFinishedSelectedImage:[UIImage imageNamed:@"首页2"] withFinishedUnselectedImage:[UIImage imageNamed:@"首页"]];
}
if ([self.tabBarController.tabBar respondsToSelector:@selector(setBackgroundImage:)])
{
// ios 5.x
[self.tabBarController.tabBar setBackgroundImage:[UIImage imageNamed:@"tabbarImg"]];
}
else
{
// ios 4.x
CGRect frame = CGRectMake(0, 0, 320, 49);
UIView *tabbg_view = [[UIView alloc] initWithFrame:frame];
UIImage *tabbag_image = [UIImage imageNamed:@"tabbarImg.png"];
UIColor *tabbg_color = [[UIColor alloc] initWithPatternImage:tabbag_image];
tabbg_view.backgroundColor = tabbg_color;
[self.tabBarController.tabBar insertSubview:tabbg_view atIndex:0];
}