Thursday, January 16, 2014

Change Background Image of Navigation Bar


Web Hosting
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;
}

Web Hosting
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