Code
UIImage *img = [UIImage imageNamed:@"chat_bg"];
// 正确拉伸图片方法1
self.right1ImgV.image = [img resizableImageWithCapInsets:UIEdgeInsetsMake(15, 15, 15, 15)];
// 正确拉伸图片方法2
self.right2ImgV.image = [img resizableImageWithCapInsets:UIEdgeInsetsMake(15, 15, 15, 15)
resizingMode:UIImageResizingModeStretch];
// 正确拉伸图片方法3
self.right3ImgV.image = [img stretchableImageWithLeftCapWidth:img.size.width * 0.5
topCapHeight:img.size.height * 0.5];
// 正确拉伸图片方法4 在 Assets.xcassets 中操作
UIImage *img1 = [UIImage imageNamed:@"chat_bg_1"];
self.right4ImgV.image = img1;
Sketch
Simulator Screen Shot.png
GitHub
Articles