Iphone 如何使自定义选项卡栏透明?
如何使自定义选项卡栏透明?我设置的背景图像是透明图像,但标签栏有黑色图像吗?如何删除黑色图像?请帮帮我。查看图像。将选项卡栏的着色颜色设置为Iphone 如何使自定义选项卡栏透明?,iphone,objective-c,xcode,uitabbar,Iphone,Objective C,Xcode,Uitabbar,如何使自定义选项卡栏透明?我设置的背景图像是透明图像,但标签栏有黑色图像吗?如何删除黑色图像?请帮帮我。查看图像。将选项卡栏的着色颜色设置为clearColor [[self tabBar] setTintColor:[UIColor clearColor]]; 试试看,创建一个图像并设置为背景ios5=>only: CGRect rect = CGRectMake(0, 0, 1, 1); UIGraphicsBeginImageContext(rect.size); CGC
clearColor
[[self tabBar] setTintColor:[UIColor clearColor]];
试试看,创建一个图像并设置为背景ios5=>only:
CGRect rect = CGRectMake(0, 0, 1, 1);
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context, [[UIColor clearColor] colorWithAlphaComponent:0.8].CGColor);
CGContextFillRect(context, rect);
UIImage *transparentImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
[self.tabBarController.tabBar setBackgroundImage:transparentImage];
您正在使用Xib吗?如果您使用的是xib,请设置“着色颜色”或将其设置为“编程调用自定义”选项卡栏,然后使用UITabBArController单独创建文件。