In this tutorial, I will show you how to customized navigation bar. Today I will show you how to change the background of navigation bar. Put this code in AppDelegate.m file
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
UIImage *navBackgroundImage = [UIImage imageNamed:@"navbar_bg.png"];
[[UINavigationBar appearance] setBackgroundImage:navBackgroundImage forBarMetrics:(UIBarMetricsDefault)];
return YES;
}
Note that the image must be size of 320 pixels width and 44 pixels height and 2times size 640 pixels width and 88 pixels height. So thats it hope you enjoy this tutorial.
No comments:
Post a Comment