2011-05-05 105 views
1

如何使UITabBar透明。可能嗎? 如果是的話請幫忙。 Thanx爲您的合作。關於標籤欄

+0

http://stackoverflow.com/questions/3735076/iphone-making-a-tab-bar-transparent的可能重複 – Krishnabhadra 2011-05-05 08:25:23

回答

-3

這裏是答案...

@interface UITabBarController (private) 
- (UITabBar *)tabBar; 
@end 

@implementation CustomUITabBarController 


- (void)viewDidLoad { 
    [super viewDidLoad]; 

    CGRect frame = CGRectMake(0.0, 0.0, self.view.bounds.size.width, 48); 
    UIView *v = [[UIView alloc] initWithFrame:frame]; 
    [v setBackgroundColor:kMainColor]; 
    [v setAlpha:0.5]; 
    [[self tabBar] addSubview:v]; 
    [v release]; 

} 
@end 

是的,它是可能的!