Under the Bridge

Shiny buttons

What’s better than an iPhone app? Why, a shiny iPhone app, of course! At least, an iPhone app with shiny buttons, which we’ll discuss today. You may recall a previous post on faking it with single segmented UISegmentedControls, but well, those just don’t work exactly the way buttons should.

The easy way to do a real button that’s shiny is to Photoshop a stretchable background image and extend UIButton slightly to use it, and here are instructions and code on how to do that; but rather than loading up our app with bitmaps, wouldn’t it be great to create arbitrary colored glossily gradiented buttons in code? Why yes, yes indeed it would. And here’s how.

Shiny Red Buttons!

Essentially, it’s wrapping Matt Gallagher’s gloss gradient code

gradientSample.png
Ooooh! Shiny!

into UIButton extensions, with some other goodies like round rect clipping and SMS.app-style bubbles. Enjoy!

h/t: The Flying Jalapeno Lives via iPhoneFlow!

0