自定义的navigationBar,设置背景方法:
IOS 5.0以前的设备添加:
@implementation UINavigationBar (CustomImage)  
- (void)drawRect:(CGRect)rect {  
    UIImage *image = [UIImage imageNamed: @"add_nav_bg_ipad.png"];  
    [image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];  
}
@end
IOS 5.0 以后的设备再添加:
在viewdidLoad中增加:
if ([self.navgationBar respondsToSelector:@selector(setBackgroundImage:forBarMetrics:)]) {
        [self.navgationBar setBackgroundImage:[UIImage imageNamed:@"add_nav_bg_ipad.png"] forBarMetrics:UIBarMetricsDefault];
    }

相关文章:

  • 2021-10-28
  • 2021-06-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-10
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-29
  • 2022-12-23
  • 2021-12-12
  • 2021-09-03
  • 2022-12-23
  • 2022-12-23
  • 2021-06-21
相关资源
相似解决方案