UIImage 自带图片拉伸函数:
<span style="font-size:18px;">- (UIImage *)stretchableImageWithLeftCapWidth:(NSInteger)leftCapWidth topCapHeight:(NSInteger)topCapHeight;</span>
例:
UIImage *img=[UIImage imageNamed:@"imageName.png"];
img=[img stretchableImageWithLeftCapWidth:5 topCapHeight:5];