iOS 拉伸图片方法
/**
* 拉伸中间
*/
+ (UIImage *)resizedImageWithName:(NSString *)name
{
UIImage *image = [self imageWithNamed:name];
return [image stretchableImageWithLeftCapWidth:image.size.width * 0.5 topCapHeight:image.size.height * 0.5];
}
/**
* 按照某一位置拉伸
*/
+ (UIImage *)resizedImageWithName:(UIImage *)image left:(CGFloat)left top:(CGFloat)top
{
// UIImage *image = [self imageWithNamed:name];
return [image stretchableImageWithLeftCapWidth:image.size.width * left topCapHeight:image.size.height * top];
}
本文详细介绍了iOS中拉伸图片的方法,包括按照特定位置拉伸的实现方式。
2001

被折叠的 条评论
为什么被折叠?



