tabbar去线加背景图片
MyTabbar *customTabBar = [[MyTabbar alloc] init];
customTabBar.frame = self.tabBar.bounds;
CGRect rect = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context, [[UIColor clearColor] CGColor]);
CGContextFillRect(context, rect);
UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
[self.tabBar setBackgroundImage:img];
[self.tabBar setShadowImage:img];
UIImage *tabbarimage=[UIImage imageNamed:@"waimai_bg"];
UIImageView *tabBarBackgroundImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0,-11,self.tabBar.frame.size.width, self.tabBar.frame.size.height+11)];
tabBarBackgroundImageView.image =tabbarimage;
[self.tabBar insertSubview:tabBarBackgroundImageView atIndex:1];
customTabBar.delegate = self;
[self.tabBar addSubview:customTabBar];
self.customTabBar = customTabBar;