//返回一个可拉升的图片(自建的方法)
- (UIImage *)resizeImageWithImageName:(NSString *)name{
UIImage *normal = [UIImage imageNamed:name];
CGFloat w = normal.size.width * 0.5 - 1 ;
CGFloat h = normal.size.height * 0.5 - 1 ;
//方法1,
//normal = [normal resizableImageWithCapInsets:UIEdgeInsetsMake(h, w, h, w)];//上 左 下 右
//方法2,
normal = [normal stretchableImageWithLeftCapWidth:h topCapHeight:w];//左 上
return normal;
} |
|