I have added Navigation bar and Navigation Item in xib. Now I need to add image to the left of Navigation bar, but its not getting added.
This is the code I’m working on:
- (void)viewDidLoad
{
UIImage *image = [UIImage imageNamed: @"i_launcher.png"];
UIImageView *imageView = [[UIImageView alloc] initWithImage: image];
self.navigationItem.titleView = imageView;
[imageView release];
}
I can’t understand why the image is not getting added. How can I add it?
UPDATE
just add this code in your
viewDidLoad:method..and also if you want to direct set image in background of NavigationBar then use bellow line…
also see this Link how-to-add-a-customized-image-button-to-uinavigationbar-in-iphone-sdk
i hope this help you…