Created
February 2, 2011 10:10
-
-
Save sumardi/807496 to your computer and use it in GitHub Desktop.
iPhoneDev - Custom background for navigation bar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)viewDidLoad { | |
self.navigationItem.title = @"Title Here" | |
// for landscape mode use - CGRectMake(0.0, 0.0, 480, 44.0)]; | |
UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake(0.0, 0.0, 320, 44.0)]; | |
[imgView setImage:[UIImage imageNamed:@"navbar_bg.png"]]; | |
// this puts image view under all other views and all the default elements (title, buttons etc) | |
[self.navigationController.navigationBar insertSubview:imgView atIndex:0]; | |
[imgView release]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment