Mani
Mani

Reputation: 1320

How to make the transparent custom tab bar?

How to make transparent custom tab bar? I set the background image is transparent image but tab bar having the black image? How to I remove the black image? Please help me. See the image.enter image description here

Upvotes: 0

Views: 2694

Answers (2)

amit soni
amit soni

Reputation: 2163

Set the TabBar's tint color to clearColor.

[[self tabBar] setTintColor:[UIColor clearColor]];

Upvotes: 1

Andrea
Andrea

Reputation: 26383

Try that, create an image and set as background 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];

Upvotes: 1

Related Questions