Since I see a modest amount of interest in my posts on Shiny Red Buttons for the iPhone, I thought I’d collect my posts on the topic into one page.
To begin with, I’d like to credit Matt Gallagher, who developed the gradient code on which these buttons rest.
Here is the latest source code for the project:
Please consider it licensed under 3-clause BSD; basically do what you like with it.
Here are the 5 original, “core” posts:
- Clipping to a rounded rectangle
- Adding Matt Gallagher’s gloss gradients
- Sweeping the code into a
- Parameter tuning
Here are some related posts
- Test code for rounded rectangles
- An alternative approach with
- “Bubble” text, as seen in the iPhone SMS app
- High-resolution buttons for iPhone 4
I never did pull together production-ready code for the more elaborate backgrounds that you see on some built-in iPhone buttons. I had been planning to do so, but, well, didn’t. Here’s what I wrote on that topic, however:
- Analysis and “moat” rendering
- Complete prototype rendering
- Clipping to hollow shapes
- Timing clipping to hollow shapes (short version: don’t bother, overdraw works fine)
Finally, I saw some memory management errors pop out of Core Graphics while running against the iPhone OS 3.0 simulator. These errors can be produced without using any Shiny Red Button code, so either there’s a problem with the CG framework in that environment, or I’ve misunderstood something. I discuss the matter here. (Addendum: These errors seem to be confined to the simulator.)