Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

beachdog

macrumors member
Original poster
Aug 10, 2008
86
0
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:

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?
 

keehun

macrumors regular
Mar 17, 2008
110
0
I think one of the reasons why its not already "easy" to do is because its outside Apple's HIG? (Human Interface Guidelines)

Why do you need the control that you somewhat described?

Can you also perhaps make a picture of a mockup? or describe in more clear detail so we can get an idea

thanks,
keehun
 

beachdog

macrumors member
Original poster
Aug 10, 2008
86
0
Can you also perhaps make a picture of a mockup? or describe in more clear detail so we can get an idea
keehun

Sure, here is a screenshot. This is an audio conferencing application, where you pick one or more Contacts to add to the invite list shown, and then click 'Start' to throw them all immediately into a conference (my server application will dial them all simultaneously).

Instead of a button labeled "Add" I would like to use the plus sign image -- when this is clicked I bring up the Contact picker and let you choose someone to add to the list.
 

Attachments

  • Snapshot 2008-08-11 08-16-14.png
    Snapshot 2008-08-11 08-16-14.png
    133.9 KB · Views: 171
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.