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.
Source Code
Here is the latest source code for the project:
Please consider it licensed under 3-clause BSD; basically do what you like with it.
Core Posts
Here are the 5 original, “core” posts:
- Introduction
- Clipping to a rounded rectangle
- Adding Matt Gallagher’s gloss gradients
- Sweeping the code into a
UIButton
category - Parameter tuning
Other Stuff
Here are some related posts
- Test code for rounded rectangles
- An alternative approach with
UISegmentedControls
- “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.)
Pingback: Things that were not immediately obvious to me » Blog Archive » Housekeeping
Pingback: Shiny buttons at Under The Bridge
Pingback: Things that were not immediately obvious to me » Blog Archive » Minesweeper (Part 8)
Pingback: Things that were not immediately obvious to me » Blog Archive » 4.0 Button Update
Pingback: Core Graphics 101: Shadows and Gloss | Ray Wenderlich