rackom
rackom

Reputation: 185

iPad - multiple UIBarButtonItem

I have UINavigationController and I`ve placed UIListView in it. Now I want to add multiple BarButtons to left side of navigation bar. How is that possible? I managed to add one button there via code but not multiple.

Edit: Buttons added via IB to NavigationBar of UINavigationController aren`t visible at all. What could cause the problem?

I`ve created UINavigationController in .h file and used this in .m and pushed another view (that TableView):

navigationController = [[UINavigationController alloc] init];
[window addSubview:[navigationController view]];

tableOfContents *tableOfContentsViewController = [[tableOfContents alloc] init];
[navigationController pushViewController:tableOfContentsViewController animated:NO];
[tableOfContentsViewController release];

Edit 2: I solved second problem. So the first question only remains. Multiple BarButtonItems ...

Upvotes: 1

Views: 863

Answers (2)

Tony
Tony

Reputation: 593

iOS 5.0 has apis to do this. Check the following properties of UINavigationItem Class

leftBarButtonItems 

rightBarButtonItems

leftItemsSupplementBackButton

Upvotes: 1

tony.tc.leung
tony.tc.leung

Reputation: 2990

The only way you can do this is to add the UIBarButtonItem to a UIToolBar and make a UIBarButtonItem with the UIToolBar as the customView.

There are many examples on the web, check out: http://osmorphis.blogspot.com/2009/05/multiple-buttons-on-navigation-bar.html

Upvotes: 1

Related Questions