- An easy way to strech image centosymmetric.
- How to install:
- Drag All files in the
AKImageCenterStrech
folder to project - Import the main file:
#import "UIImage+RelativeCenterStretch.h"
- Drag All files in the
- How to use:
//horizon strech:
UIImage *horizonStrechImage =
[originImage stretchWithFinalWidth:240 leftCapInset:40 leftStretchSpacing:2 rightCapInset:40 rightStretchSpacing:2];
//Vertical strech:
UIImage *verticalStrechImage = [originImage stretchWithFinalHeight:240 topCapInset:40 topStretchSpacing:2 bottomCapInset:40 bottomStretchSpacing:2];
//center Strech:
UIImage *horizonStrechedImage = [originImage stretchWithFinalWidth:240 leftCapInset:40 leftStretchSpacing:2 rightCapInset:40 rightStretchSpacing:2];
UIImage *centerStrechImage = [horizonStrechedImage stretchWithFinalHeight:240 topCapInset:40 topStretchSpacing:2 bottomCapInset:40 bottomStretchSpacing:2];
- orgin image:
- strech image:
- How to completion: