Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 25th, 2012  |  syntax: None  |  size: 0.54 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. UINavigationBar background from an image
  2. for(UIView *view in self.navigationController.navigationBar.subviews)
  3. {
  4.     if([view isKindOfClass:[UIImageView class]])
  5.     {
  6.         [view removeFromSuperview];
  7.     }
  8. }
  9.  
  10. UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"navBarBG.png"]];
  11. [self.navigationController.navigationBar addSubview:imageView];
  12. [self.navigationController.navigationBar sendSubviewToBack:imageView];
  13. [imageView release];
  14.  
  15. [self.navigationController.navigationBar setTintColor:[UIColor clearColor]];