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.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you create a
UIToolBar, add your buttons to it, and then make it yourleftNavBarItemorrightNavBarItem, 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
UIButtonand useUIBarButtonIteminstead. Bar button items are designed to look “right” when sitting on a navigation bar or toolbar. I’d steer clear ofUIButtonunless you need a custom look, and even then it needs to be embedded in aUIBarButtonItemas a custom view.