tags:

views:

371

answers:

2

I'm using the standard code for setting up my TabBarController, but I can't for the life of me get it to be translucent. I overlay a view with my TabBarController, I would like that image to show through the TBC. Actually I want the bar to just fade away like the Photo app does after a few seconds, but for now, one step at a time. Translucent first. thanks

- (void)applicationDidFinishLaunching:(UIApplication *)application 
{ 

 tabBarController = [[UITabBarController alloc] init]; 

 //tabBarController.tabBar.barStyle = UIBarStyleBlackTranslucent;

 //ERROR: request for member in something not a structure of member

 //BUT this will work! But just affects the alpha value

 tabBarController.tabBar.alpha = .5;

 view1Controller = [[View1Controller alloc] init];  
 view2Controller = [[View2Controller alloc] init]; 
 view3Controller = [[View3Controller alloc] init]; 

 tabBarController.viewControllers = [NSArray arrayWithObjects:view1Controller, view2Controller, view3Controller, nil];  

 [window addSubview:tabBarController.view]; 
 [window makeKeyAndVisible]; 
}
A: 

To make a Tab Bar transparent, set tabBar.Opaque to No. You can then adjust the tabBar.alpha value to adjust the level of transparency. It is possible to animate this change.

From the docs for UIView: "@property(nonatomic) CGFloat alpha Discussion Changes to this property can be animated. Use the beginAnimations:context: class method to begin and the commitAnimations class method to end an animation block."

Chris
WOW, thanks Chris.
ed potter
A: 

Oh, hmmmmmm ... setting tabBarController.tabBar.opaque = NO does not seem to do anything. No change if I say YES or NO.

ed potter