//直接上代码
CGRect rect = CGRectMake(0,0, self.view.frame.size.width,self.view.frame.size.height);
UIGraphicsBeginImageContext(rect.size);
CGContextRef context =UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context, [[UIColorclearColor] CGColor]);
CGContextFillRect(context, rect);
UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
[self.tabBarsetBackgroundImage:img];
[self.tabBarsetShadowImage:img];