add UIButtons to UINavigationController?

I have a splitViewController and I would like to add a couple of buttons to the navigation bar for certain details views - is this possible? Looking at the API I only see a leftNavbarItem and a rightNavBarItem.

Answers


If you create a UIToolBar, add your buttons to it, and then make it your leftNavBarItem or rightNavBarItem, the navigation bar is smart enough to make the buttons appear as though they're sitting on the navigation bar. So you get the illusion of having multiple button items when they are in fact part of a toolbar.

Also, I'd advise against using UIButton and use UIBarButtonItem instead. Bar button items are designed to look "right" when sitting on a navigation bar or toolbar. I'd steer clear of UIButton unless you need a custom look, and even then it needs to be embedded in a UIBarButtonItem as a custom view.


Need Your Help

How can I read the response from a web request when the Status is not 200?

vb.net webexception

I am having difficulty getting the response text from a HTTP web request in vb.net when I get a web exception.