How to add image in the navigation bar of iPhone in objective C?


Put this code in the viewDidLoad method of that view in which you want to add image in the bar code:

[[self.navigationController navigationBar] setBackgroundImage:[UIImage imageNamed:@”ImgName.png”] forBarMetrics:UIBarMetricsDefault];

This will add image in the navigation bar for all view. If you want different image for different view then it will be manage by viewWillAppear and viewDidAppear mehods by proper handling.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s