/** * 返回一张可以随意拉伸不变形的图片 * * @param name 图片名字 */ + (UIImage *)resizableImage:(NSString *)name { UIImage *normal = [UIImage imageNamed:name]; CGFloat w = normal.size.width * 0.5; CGFloat h = normal.size.height * 0.5; return [normal resizableImageWithCapInsets:UIEdgeInsetsMake(h, w, h, w)]; }
时间: 2024-09-28 06:27:37