Tuesday, April 23, 2013

UIImage UIImageResizingModeStretch example ios


UIImageResizingMode - UIImageResizingModeStretch

Specifies the possible resizing modes for an image.
typedef enum {
   UIImageResizingModeTile,
   UIImageResizingModeStretch,
} UIImageResizingMode;
Constants
UIImageResizingModeTile
The image is tiled when it is resized. In other words, the interior region of the original image will be repeated to fill in the interior region of the newly resized image.
Available in iOS 6.0 and later.
Declared in UIImage.h.
UIImageResizingModeStretch
The image is stretched when it is resized. In other words, the interior region of the original image will be scaled to fill in the interior region of the newly resized imaged.
Available in iOS 6.0 and later.
Declared in UIImage.h.
Example of UIImageResizingModeStretch
if ([UIImage instancesRespondToSelector:@selector(resizableImageWithCapInsets:resizingMode:)] {
    self.scrollViewImage.image = [[UIImage imageNamed:@"SysInfoBackBox"] resizableImageWithCapInsets:UIEdgeInsetsMake(40, 40, 40, 40) resizingMode:UIImageResizingModeStretch];
} else {
    // alternative 
}Example of UIImageResizingModeStretch