How can i add a next and previous button at the segmented Controller on a navigation bar in iphone application development?

我怕爱的太早我们不能终老 提交于 2019-12-07 02:15:32
DShah

Firstly in figure the NavigationBar you are seeing is actually UIToolBar. Unfortunately it is not possible to add anymore controls on the UINavigationBar. But you can achieve exactly same UI with UIToolBar where you can add any controls.

So to achieve this use UIToolBar and not UINavigationBar. Also use UIBarButtonItem with custom title to achieve Next and Previous functionality.

EDIT

Here are few links for example of UIToolBar

  1. http://www.codeproject.com/Articles/43658/How-to-Make-a-Toolbar-with-UIToolbar
  2. http://osmorphis.blogspot.com/2009/05/multiple-buttons-on-navigation-bar.html
  3. http://atastypixel.com/blog/making-uitoolbar-and-uinavigationbars-background-totally-transparent/

But this all explains using codes. Instead using Interface Builder, it becomes too easy to use UIToolBar (if coding is not so important).

I think this is being slightly overcomplicated- can you not just set the text of the two UIBarButtonItems to "<" and ">"?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!