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?
Asked
Active
Viewed 122 times
1 Answers
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
-
Thank you very much my problem is resolved – Nagesh Kumar Mishra Jan 30 '12 at 11:55
-
you are always welcome.. – Praveen Jan 30 '12 at 11:56