Iphone 正在尝试将tabBarController设置为半透明。但不起作用。可以设置Alpha

Iphone 正在尝试将tabBarController设置为半透明。但不起作用。可以设置Alpha,iphone,Iphone,我使用标准代码来设置TabBarController,但我无法让它成为半透明的。我用我的TabBarController覆盖一个视图,我希望该图像通过TBC显示。事实上,我希望酒吧在几秒钟后像照片应用程序一样淡出,但现在,一步一个脚印。首先是半透明的。谢谢 - (void)applicationDidFinishLaunching:(UIApplication *)application { tabBarController = [[UITabBarController alloc] i

我使用标准代码来设置TabBarController,但我无法让它成为半透明的。我用我的TabBarController覆盖一个视图,我希望该图像通过TBC显示。事实上,我希望酒吧在几秒钟后像照片应用程序一样淡出,但现在,一步一个脚印。首先是半透明的。谢谢

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

要使选项卡栏透明,请将tabBar.不透明设置为否。然后可以调整tabBar.alpha值以调整透明度级别。可以设置此更改的动画

从UIView的文档中: “@属性(非原子)CGFloat alpha 讨论
对该属性的更改可以设置动画。使用beginAnimations:context:class方法开始动画块,使用commitAnimations类方法结束动画块。

要使选项卡栏透明,请将tabBar.不透明设置为否。然后可以调整tabBar.alpha值以调整透明度级别。可以设置此更改的动画

从UIView的文档中: “@属性(非原子)CGFloat alpha 讨论 对该属性的更改可以设置动画。使用beginAnimations:context:class方法开始动画块,使用commitAnimations类方法结束动画块。