2012-02-28 154 views

回答

0

在viewController.m文件試試這個方法viewDidLoad

for(UIView *view in self.navigationController.navigationBar.subviews) 
{ 
    if([view isKindOfClass:[UIImageView class]]) 
    { 
     [view removeFromSuperview]; 
    } 
} 

UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"navBarBG.png"]]; 
[self.navigationController.navigationBar addSubview:imageView]; 
[self.navigationController.navigationBar sendSubviewToBack:imageView]; 
[imageView release]; 

[self.navigationController.navigationBar setTintColor:[UIColor clearColor]];