Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

lg3

macrumors newbie
Original poster
Apr 16, 2012
6
0
Hi-

I am wondering how I can make a tab bar appear transparent to the user.
I have created a tab bar from scratch and use the Appearance APIS in my app delegate to create a custom look. I know I have to set the alpha of the tab bar to less than one (or at least I think!) which I did. Do I also need to have the tab bar image I am using be transparent?

Any guidance would be appreciated.

Code:
- (void)customizeAppearance
{
    // Create resizable images
    UIImage *gradientImage44 = [[UIImage imageNamed:@"nav_bar"] 
                                resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
      
    UIImage *tabBackground = [[UIImage imageNamed:@"tab_bar"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
    [[UITabBar appearance] setBackgroundImage:tabBackground];
    
    
    [[UITabBar appearance] setSelectionIndicatorImage:
     [UIImage imageNamed:@"empty_selection"]];
    
    
    [[UINavigationBar appearance] setBackgroundImage:gradientImage44 
                                       forBarMetrics:UIBarMetricsDefault];

    [[UITabBar appearance] setAlpha:0.5];
}
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.