iOS 拉伸图片

来源:互联网 发布:适合les质量好淘宝店 编辑:程序博客网 时间:2024/06/10 04:47


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];}


0 0
原创粉丝点击