Actually I added two button (UIButtonBarItem) and assigned it to to NavigationItem's rightbarbuttonitem but only edit button is visible and add button is not visible but when we click on it it gets invoked ? chk it out my code http://pastebin.com/Ew4zPEUz
Asked
Active
Viewed 80 times
2 Answers
2
Try using this code in ViewDidload
method
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
button.frame = CGRectMake(0,0,60,30);
[button setImage:[UIImage imageNamed:@"iPhoneBackButton.png"] forState:UIControlStateNormal];
[button addTarget:self action:@selector(back:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *barButtonItem = [[UIBarButtonItem alloc] initWithCustomView:button];
self.navigationItem.rightBarButtonItem=barButtonItem;

indyfromoz
- 4,045
- 26
- 24

Rushi trivedi
- 737
- 1
- 15
- 37
-
He wanted more than one button. – Millie Smith Mar 20 '14 at 05:39
-
well .. thanx for commenting @indianarmy but in my case i was trying to insert UIBarButtonItem and it was not visible ..but now solved it – Shobhakar Tiwari Mar 20 '14 at 05:39
-
http://stackoverflow.com/questions/9867259/how-can-i-add-multiple-uibarbuttonitems-to-a-uinavigationbar it will be help[full – Rushi trivedi Mar 20 '14 at 05:42
0
finally solved this problem .
just removed below line
self.navigationItem.rightBarButtonItem.tintColor=[UIColor clearColor]
and its works :)

Rahul Patel
- 5,858
- 6
- 46
- 72

Shobhakar Tiwari
- 7,862
- 4
- 36
- 71