0

I have menu button that is being put in the Navigation controller on every page in the rightBarButtonItem (customer wishes) from a my BaseViewController (all other classes inherit from this).

I want to add a segment controller next to the menu button on one of the pages.

Is there a way to just add a segment controller next to it without replacing one or the other?

I have seen examples of adding 2 items into one controller, but I need to add them at separate times.

smcdrc
  • 1,671
  • 2
  • 21
  • 29

1 Answers1

1

You will need to create a view that contains the menu button and the segmented button and then create a UIBarButtonItem using initWithCustomView:(UIView *)customView and pass the view with the buttons. Then set rightBarButtonItem to this barButtonItem.

jamihash
  • 1,900
  • 1
  • 12
  • 15
  • Is there a way to get a the current rightBarButtonItem (the current button) and then add that to a new view with my new segment control? – smcdrc Jan 09 '11 at 11:24
  • Not that I know of. Note that the rightBarButtonItem is of type BarButtonItem which is not a subclass of UIView. – jamihash Jan 11 '11 at 02:18