+ (UIImage *)resizedImage:(NSString *)name
{
UIImage *image = [UIImage imageWithName:name];
return [image stretchableImageWithLeftCapWidth:image.size.width * 0.5 topCapHeight:image.size.height * 0.5];
}
参考:http://www.cnblogs.com/bandy/archive/2012/04/25/2469369.html