PDA

View Full Version : replicating NSButton Checkbox




icewing
Oct 12, 2009, 12:02 PM
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!



dejo
Oct 12, 2009, 12:15 PM
Have you considered using UISwitch instead? Works very much like a checkbox (toggles two states) and will be familiar to end users.

icewing
Oct 12, 2009, 01:49 PM
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?

dejo
Oct 12, 2009, 02:04 PM
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.

icewing
Oct 12, 2009, 02:31 PM
Thanks for the tip, I'll check into it. Newb out...

PhoneyDeveloper
Oct 12, 2009, 03:00 PM
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/

icewing
Sep 6, 2010, 02:03 AM
that link is broken - tried searching and no joy - can anyone point me to a way to do this? Thanks!

PhoneyDeveloper
Sep 6, 2010, 10:11 AM
The method in that link doesn't work anymore. I don't know of a way to get all the images currently.