iOS How To: Stretch UIImage
There is a quick and easy way to stretch an image inside an object without it distorting any curves or diagonal lines. The following method will stretch an image at a given X and/or Y position of the image file. So you’ll want to find a spots that are straight horizontal or vertical lines. The code below will move in 20 pixels from the left and stretch the image at that point. So now you can include the buttonImage as the background image for any other object and it will stretch the image to look correctly no matter what the width.
The examples above are using the same image file.
// Stretch an image UIImage *buttonImage = [[UIImage imageNamed:@"button.png"] stretchableImageWithLeftCapWidth:20 topCapHeight:0];