CGRect rect = CGRectMake(0, 0, SCREEN_WIDTH, 0.5);
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context,RGB(231, 231, 231).CGColor);
CGContextFillRect(context, rect);
UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
[self.tabBar setShadowImage:img];
[self.tabBar setBackgroundImage:[[UIImage alloc]init]];
网友评论