开发者

iPad - multiple UIBarButtonItem

开发者 https://www.devze.com 2023-01-05 05:01 出处:网络
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 开发者

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 开发者_JAVA技巧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 ...


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

leftBarButtonItems 

rightBarButtonItems

leftItemsSupplementBackButton


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

0

精彩评论

暂无评论...
验证码 换一张
取 消