/** * 根据图片名返回一张能够自由拉伸的图片 */ +(UIImage *)resizedImage:(NSString *)name { UIImage *image=[UIImage imageWithName:name]; return [image stretchableImageWithLeftCapWidth:image.size.width*0.5 topCapHeight:image.size.height*0.5]; }
时间: 2024-12-14 16:22:05
/** * 根据图片名返回一张能够自由拉伸的图片 */ +(UIImage *)resizedImage:(NSString *)name { UIImage *image=[UIImage imageWithName:name]; return [image stretchableImageWithLeftCapWidth:image.size.width*0.5 topCapHeight:image.size.height*0.5]; }