-5

For the navigation controller I have onscreen, I'd like to place two images within the navigation bar. Is there a way to do this? If so, how?

Brad Larson
  • 170,088
  • 45
  • 397
  • 571

1 Answers1

0

One way to do this is to use UINavigationItem.titleView and UINavigationItem.rightBarButtonItem. Like this :

viewController.navigationItem.titleView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"yourimage.png"]];
UIBarButtonItem * item = [[UIBarButtonItem alloc] initWithCustomView:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"yourimage2.jpg"]]];    
viewController.navigationItem.rightBarButtonItem = item; 

Here I am using UIImageView as custom view, but it can be UIButton with custom image.

Check this: How to add image in UINavigationBar in IPhone app

Community
  • 1
  • 1
Praveen
  • 301
  • 2
  • 11