2
我在IOS 4+上试过这个代码,它完美地工作,但直到我的队友在IOS 5+上测试它为止。这是代码将导航栏背景更改为图像
@implementation UINavigationBar (CustomImage)
// Set the navigation bar background
- (void)drawRect:(CGRect)rect {
UIImage *image = [UIImage imageNamed:@"background.png"];
[image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
}
@end
我需要一个代码,适用于IOS 4 +和IOS 5+,请帮助我。