步骤如下:
//1-设置一个什么图片都没有的bgImg当做tabBar的背景图片!!!
UIImage*bgImg = [[UIImagealloc]init];
[self.tabBarsetBackgroundImage:bgImg];
[self.tabBarsetShadowImage:bgImg];
//2-自定义一个backView,并设置backView为半透明(alpha设置为0.5)
UIView*backView = [[UIViewalloc]init];
backView.backgroundColor= [UIColorblueColor];
backView.frame=self.tabBar.bounds;
backView.alpha=0.5;
//3-将自定义的backView插入到当前的tabBar当中
[self.tabBarinsertSubview:backViewatIndex:0];