I wrote the following code to make my toolbar transparent.
[mtoolbar setBackgroundColor:[UIColor clearColor]];
How do I make UIToolbar
Setting the property translucent
to YES
will not work in iOS 5 and below. Here's how it can be done without subclassing toolbar:
const float colorMask[6] = {222, 255, 222, 255, 222, 255};
UIImage *img = [[UIImage alloc] init];
UIImage *maskedImage = [UIImage imageWithCGImage: CGImageCreateWithMaskingColors(img.CGImage, colorMask)];
[self.toolbar setBackgroundImage:maskedImage forToolbarPosition:UIToolbarPositionAny barMetrics:UIBarMetricsDefault];