Thursday, January 16, 2014

Change the background image of bar button in 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 image of back button background image of navigation bar. Put this code in AppDelegate.m file

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
UIImage *backButtonImage = [[UIImage imageNamed:@"button_back"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 13, 0, 6)];
    [[UIBarButtonItem appearance] setBackButtonBackgroundImage:backButtonImage forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];

return YES;
}

Web Hosting
So thats it hope you enjoy this tutorial. Note that the size of the image is 50pixels in width and 30pixels in height.

No comments:

Post a Comment