I want to create a navigation controller that uses a custom view for the right bar button. I'd like the view to contain a segmented control with two buttons --one containing the "plus sign" image (like you see in the Contacts application when adding a contact), and then a second button which will just have a string.
The NavBar sample pretty much shows most of how to do this, but my question is, how can I get that standard system plus sign image into my segmented control? If I wanted to just have a single button on the right with that image I could do this:
However, to use a segmented control with two buttons, I need to get the image to use in a UIImage so I can initialize the segmented control with that image.
Is there any library of standard system images that is available to initialize a UIImage with, similar to what is available for UIBarButtons?
Alternatively, is there a way I can programmatically create a UIImage and base it on a UIBarButtonItem instance, where I have previously loaded that image into the UIBarButtonItem?
The NavBar sample pretty much shows most of how to do this, but my question is, how can I get that standard system plus sign image into my segmented control? If I wanted to just have a single button on the right with that image I could do this:
Code:
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self
action:@selector(addParticipant:)];
However, to use a segmented control with two buttons, I need to get the image to use in a UIImage so I can initialize the segmented control with that image.
Is there any library of standard system images that is available to initialize a UIImage with, similar to what is available for UIBarButtons?
Alternatively, is there a way I can programmatically create a UIImage and base it on a UIBarButtonItem instance, where I have previously loaded that image into the UIBarButtonItem?