The iOS framework that grows only as fast as its documentation
Image Utilities

Functions

UIImage * NIStretchableImageFromImage (UIImage *image)
 

Overview

For manipulating UIImage objects.

Function Documentation

NIStretchableImageFromImage

Returns an image that is stretchable from the center.

UIImage* NIStretchableImageFromImage:(UIImage *)image;
Discussion

A common use of this method is to create an image that has rounded corners for a button and then assign a stretchable version of that image to a UIButton.

This stretches the middle vertical and horizontal line of pixels, so use care when stretching images that have gradients. For example, an image with a vertical gradient can be stretched horizontally, but will look odd if stretched vertically.