Erica Sadun linked to Jonathan Wight’s nifty use of a private UIGlassButton class to make shiny “glass” iPhone buttons, and here are a few tricks on using it well.
First up, I like making a new Utility Application in XCode for this, because you can plug Jonathan’s code into the showInfo method. When you run the app in the simulator, just tap the info button to generate the button image.
And as for the button image itself, I recommend setting the height of the image (in CGRectMake) to the exact height of the button you are going to be using, plus 8 pixels due to the empty space around the button image where shaodw live. If you’re using Interface Builder, check the Size Inspector tab to see what the height of your button is. Sure, the iPhone SDK will resize your image to fit whatever button size you’re using, but it won’t be pixel perfect. Also I set the width at 29, as you don’t really need more width than that for making a resizable button image, such as in the following code:
UIImage *blueButtonImage = [[UIImage imageNamed:@"blueButton.png"] stretchableImageWithLeftCapWidth:12 topCapHeight:0];
[myButton setBackgroundImage:blueButtonImage forState:UIControlStateNormal];
For more details on the right Interface Builder settings for custom UIButtons (such as to be sure to pick Custom for button type or you’ll end up with an ugly gray outline), check out Christopher McCulloh’s tutorial.

