tags:

views:

23

answers:

1

I slightly remember that there is an class which is capable of stretching an image in such a way, that the first x pixels and the last y pixels won't get stretched.

For example if you have an button image with round corners, you would want those round corners to stay intact while the middle part of that image gets stretched.

+2  A: 

This is a feature of class UIImage itself.

- (UIImage *)stretchableImageWithLeftCapWidth:(NSInteger)leftCapWidth  topCapHeight:(NSInteger)topCapHeight

You can assign the resulting image to the appropriate property of UIButton as required.

Dirk
Specifically, most likely the backgroundImage property.
Ben Gottlieb