- (UIImage *)resizableImageWithCapInsets:(UIEdgeInsets)capInsets resizingMode:(UIImageResizingMode)resizingMode NS_AVAILABLE_IOS(6_0); // the interior is resized according to the resizingModespa
+ (UIImage *)resizableImageWithName:(NSString *)imageName3d
{orm
// 加載原有圖片圖片
UIImage *norImage = [UIImage imageNamed:imageName];it
// 獲取原有圖片的寬高的一半io
CGFloat w = norImage.size.width * 0.5;im
CGFloat h = norImage.size.height * 0.5;margin
// 生成能夠拉伸指定位置的圖片top
UIImage *newImage = [norImage resizableImageWithCapInsets:UIEdgeInsetsMake(h, w, h, w) resizingMode:UIImageResizingModeStretch];di
return newImage;
}