2009-09-04 82 views
1

我使用标准的代码来设置我的TabBarController,但我不能让我的生活变得半透明。我用TabBarController覆盖了一个视图,我希望通过TBC显示该图像。实际上,我希望酒吧在几秒钟后像Photo应用程序一样消失,但现在只需一步一步。首先是半透明的。感谢试图设置tabBarController半透明。但不工作。阿尔法可以设置

- (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]; 
} 

回答

1

为了使标签栏透明,tabBar.Opaque设置为否。然后,您可以调整tabBar.alpha值调整的透明度。这是可能的动画这一变化。

从文档为的UIView: “@属性(非原子)CGFloat的阿尔法 讨论 更改该属性可以是动画使用beginAnimations:context:类方法来开始和commitAnimations类方法来结束动画

+0

哇,谢谢克里斯。 – 2009-09-09 00:52:47