Need a long button that stretches to your content? Well it’s really easy on the iPhone with the help of stretchableImageWithLeftCapWidth
Create one image with a left and right caps. Note the width of these caps (make sure they are equal) and voila. So your image will have three parts a left cap, a center (stretchable area) and a left cap.
UIImage *addButtonImage = [[UIImage imageNamed:@"greenButtonStretchable.png"] stretchableImageWithLeftCapWidth:17.0 topCapHeight:0];
[addButton setBackgroundColor:[UIColor clearColor]];
[addButton setBackgroundImage:addButtonImage forState:UIControlStateNormal];
Need a better explanation of how this works? Let me know in the comments!