Can I get UIImage for UIBarButtonSystemItemAdd?

Discussion in 'iOS Programming' started by beachdog, Aug 10, 2008.

  1. beachdog macrumors member

    Aug 10, 2008
    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:

    self.navigationItem.rightBarButtonItem =  [[UIBarButtonItem alloc]
     initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self 
    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?
  2. keehun macrumors regular

    Mar 17, 2008
    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

  3. beachdog thread starter macrumors member

    Aug 10, 2008
    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.

    Attached Files:

Share This Page