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.
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.
精彩评论