Skip to content

Comment on Designing for iOS: Taming UIButton

Comments

    A recently introduced second option consists
    in using a resizable image as a button background
    after having set its resizable and non-resizable
    areas in code. Start by making a pill-shaped
    background image in your graphic editor.
Not accurate. -[UIImage stretchableImageWithLeftCapWidth:topCapHeight] has been around since the first public SDK release. Although, I must say the -resizableImageWithCapInsets: methods added in iOS 5 and 6 are far more powerful.

Also, here are a bunch of UIButton subclasses that I think are pretty neat that demonstrate some of the techniques described in the article, plus others:

http://www.cocoacontrols.com/platforms/ios/controls/bbutton

http://www.cocoacontrols.com/platforms/ios/controls/psstoreb...

http://www.cocoacontrols.com/platforms/ios/controls/gloss-ca...

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.