replicating NSButton Checkbox

Discussion in 'iOS Programming' started by icewing, Oct 12, 2009.

  1. icewing macrumors 6502

    Joined:
    Jun 19, 2008
    Location:
    St Louis
    #1
    In Interface Builder, there is no checkbox, like the NSButton in Appkit available for OS X applications, only UIButton. I've searched and found a few examples using custom icons, which were OK, but I'd like to use the same images that Apple uses for the OS X checkbox. I looked but couldn't find the .png images - do they exist anywhere?

    Thanks!
     
  2. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    Have you considered using UISwitch instead? Works very much like a checkbox (toggles two states) and will be familiar to end users.
     
  3. icewing thread starter macrumors 6502

    Joined:
    Jun 19, 2008
    Location:
    St Louis
    #3
    Thanks for your reply! Yes, I have, but I don't like the look. It's going to be in a tableview, and the UISwitch takes up a lot of real estate. Check boxes have a long history in lists, and I'm wondering why Apple didn't include that for iPhone apps...hopefully someday they will.

    Any idea if I might be able to find the images anywhere?
     
  4. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #4
    Well, if you're doing checkmarks in a tableView, you might want to consider using UITableViewCellAccessoryCheckmark.

    As for where the images might be, sorry, I have no idea.
     
  5. icewing thread starter macrumors 6502

    Joined:
    Jun 19, 2008
    Location:
    St Louis
    #5
    Thanks for the tip, I'll check into it. Newb out...
     
  6. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #6
    If you want to use the checkmark as an accessory see the Accessory sample code. It shows how to toggle between two images as the accessory view for a table view.

    I don't know if anyone has written a toggle button that will just toggle between two states and two appearances.

    View this link for a way to get all the UIKit images

    http://snipplr.com/view/13894/extract-uikit-artwork/
     
  7. icewing thread starter macrumors 6502

    Joined:
    Jun 19, 2008
    Location:
    St Louis
    #7
    that link is broken - tried searching and no joy - can anyone point me to a way to do this? Thanks!
     
  8. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #8
    The method in that link doesn't work anymore. I don't know of a way to get all the images currently.
     

Share This Page